I've got a public docker container at docker.com and I'm trying to unsuccesfully get Watchtower to automatically pull when the container is updated. This worked many months ago but is not now. I created watchtower container with docker-compose (I was using the default launch command previously with no token and it was working).
One point that confuses me is that since this is a public container, I'd not think I need any auth to pull it.
Here is the docker logs of watchtower showing the 401 auth error.
time="2021-11-29T15:26:06Z" level=debug msg="No new images found for /documents_watchtower_1"
time="2021-11-29T15:26:06Z" level=debug msg="Trying to load authentication credentials." container=/web image="pkellner/svccps1:3.0.63"
time="2021-11-29T15:26:06Z" level=debug msg="No credentials for pkellner found" config_file=/config.json
time="2021-11-29T15:26:06Z" level=debug msg="Got image name: pkellner/svccps1:3.0.63"
time="2021-11-29T15:26:06Z" level=debug msg="Checking if pull is needed" container=/web image="pkellner/svccps1:3.0.63"
time="2021-11-29T15:26:06Z" level=debug msg="Building challenge URL" URL="https://index.docker.io/v2/"
time="2021-11-29T15:26:06Z" level=debug msg="Got response to challenge request" header="Bearer realm=\"https://auth.docker.io/token\",service=\"registry.docker.io\"" status="401 Unauthorized"
time="2021-11-29T15:26:06Z" level=debug msg="Checking challenge header content" realm="https://auth.docker.io/token" service=registry.docker.io
time="2021-11-29T15:26:06Z" level=debug msg="Setting scope for auth token" image=pkellner/svccps1 scope="repository:pkellner/svccps1:pull"
time="2021-11-29T15:26:06Z" level=debug msg="No credentials found."
time="2021-11-29T15:26:07Z" level=debug msg="Parsing image ref" host=index.docker.io image=pkellner/svccps1 normalized="docker.io/pkellner/svccps1:3.0.63" tag=3.0.63
time="2021-11-29T15:26:07Z" level=debug msg="Doing a HEAD request to fetch a digest" url="https://index.docker.io/v2/pkellner/svccps1/manifests/3.0.63"
time="2021-11-29T15:26:07Z" level=debug msg="Found a remote digest to compare with" remote="sha256:xxx"
time="2021-11-29T15:26:07Z" level=debug msg=Comparing local="sha256:xxx" remote="sha256:xxx"
time="2021-11-29T15:26:07Z" level=debug msg="Found a match"
time="2021-11-29T15:26:07Z" level=debug msg="No pull needed. Skipping image."
time="2021-11-29T15:26:07Z" level=debug msg="No new images found for /web"
My docker-compose file:
services:
watchtower:
image: containrrr/watchtower
restart: always
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /etc/timezone:/etc/timezone:ro
environment:
- WATCHTOWER_CLEANUP=true
- WATCHTOWER_LABEL_ENABLE=true
- WATCHTOWER_INCLUDE_RESTARTING=true
- WATCHTOWER_HTTP_API_TOKEN=xxxxxxx{from docker.com token}
- WATCHTOWER_DEBUG=true
- WATCHTOWER_POLL_INTERVAL=60
labels:
- "com.centurylinklabs.watchtower.enable=true"