I have a Waypoint runner task running in a Nomad cluster. I have it watching a remote git
repository.
app "test" {
build {
use "docker" {}
}
deploy {
use "docker" {}
}
}
When the runner sees a change in the repository and tries to run the build
step, it returns an error:
2022-11-03T03:17:08.951Z [WARN] waypoint.runner.agent.runner: error during job execution:
job_id=01GGXQW1Y1JETX8T7F1GHFY94G
job_op=*gen.Job_Up
err="rpc error:
code = Internal
desc = error building image:
Cannot connect to the Docker daemon at unix:///var/run/docker.sock.
Is the docker daemon running?"
Can Docker be used in this way? I found a post that mentioned a lack of support for docker-pull in on-demand runners. Perhaps this is related.
Here is my task definition:
task "runner" {
driver = "exec"
lifecycle {
hook = "poststart"
sidecar = "true"
}
config {
command = "/bin/bash"
args = ["${NOMAD_TASK_DIR}/waypoint_runner.sh"]
}
template {
destination = "${NOMAD_TASK_DIR}/waypoint_runner.sh"
perms = "644"
data = <<EOF
#!/bin/bash
set -eux
until [ -s ${NOMAD_ALLOC_DIR}/bootstrap.token ]; do
sleep 1
done
export WAYPOINT_SERVER_ADDR="localhost:{{ env "NOMAD_PORT_server" }}"
export WAYPOINT_SERVER_TLS=true
export WAYPOINT_SERVER_TLS_SKIP_VERIFY=true
export WAYPOINT_SERVER_TOKEN=$(<{{env "NOMAD_ALLOC_DIR"}}/bootstrap.token)
${NOMAD_ALLOC_DIR}/waypoint runner agent
EOF
}
}