Skip to content

Instantly share code, notes, and snippets.

@paladin-devops
Created June 1, 2022 14:32
Show Gist options
  • Save paladin-devops/e3cb17ec243a592af38c1a4505ca731d to your computer and use it in GitHub Desktop.
Save paladin-devops/e3cb17ec243a592af38c1a4505ca731d to your computer and use it in GitHub Desktop.
`waypoint build` with functioning remote operations for `docker-pull` builder
% waypoint build -local=false -var=user=username -var=pass=password
» Building example-nodejs...
There are local changes that do not match the remote repository. By default,
Waypoint will perform this operation using a remote runner that will use the
remote repository’s git ref and not these local changes. For these changes
to be used for future operations, either commit and push, or run the operation
locally with the -local flag.
Performing operation on "docker" with runner profile "docker"
» Cloning data from Git
URL: https://github.com/hashicorp/waypoint-examples
Ref: docker-pull-remote-test
✓ Running build v5
✓ Injecting entrypoint...
⠙ Executing Kaniko...
│ INFO[0000] Retrieving image manifest node:latest
│ INFO[0000] Retrieving image node:latest from registry index.docker.io
│ INFO[0000] Built cross stage deps: map[]
│ INFO[0000] Retrieving image manifest node:latest
│ INFO[0000] Returning cached image manifest
│ INFO[0000] Executing 0 build triggers
│ INFO[0000] Skipping unpacking as no commands require it.
│ INFO[0000] Pushing image to localhost:39079/myrepo/nodejs-example:latest
│ INFO[0001] Pushed image to 1 destinations
✓ Image pull completed.
✓ Running push build v4
✓ Tagging Docker image: myrepo/nodejs-example:latest => myrepo/nodejs-example:latest
✓ Pushing Docker image...
│ 5cd94bddda4d: Layer already exists
│ 00a6e2ec123c: Layer already exists
│ 9e8a8e4e0b92: Layer already exists
│ 2fbabeba902e: Layer already exists
│ ee509ed6e976: Layer already exists
│ 9177197c67d0: Layer already exists
│ 7dbadf2b9bd8: Layer already exists
│ e7597c345c2e: Layer already exists
│ latest: digest: sha256:a6f4eacb3a1af6d692997dd2906bcfe33be61761118b6da1136f40ec3
│ 5cf3677 size: 2427
✓ Docker image pushed: myrepo/nodejs-example:latest
Created artifact v4
project = "example-nodejs"
app "example-nodejs" {
build {
use "docker-pull" {
image = "node"
tag = "latest"
}
registry {
use "docker" {
image = "myrepo/nodejs-example"
tag = "latest"
auth {
username = var.user
password = var.pass
}
}
}
}
deploy {
use "nomad" {
// these options both default to the values shown, but are left here to
// show they are configurable
datacenter = "dc1"
namespace = "default"
}
}
}
variable "user" {
type = string
sensitive = true
}
variable "pass" {
type = string
sensitive = true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment