watchtower: label com.centurylinklabs.watchtower.enable=false is ignored

Running a container with the com.centurylinklabs.watchtower.enable set to false seems to be ignored…

docker run -dit \
  ...
  --label=com.centurylinklabs.watchtower.enable=false \
  nodered/node-red-docker:slim-v8

docker run -it --rm \
  --name watchtower \
  -v /home/ms/.docker/config.json:/config.json \
  -v /var/run/docker.sock:/var/run/docker.sock \
  v2tec/watchtower --debug

Confirm label with docker inspect:

"Labels": {
                "com.centurylinklabs.watchtower.enable": "false"
            }

watchtower ignores the label…

DEBU[0000] Retrieving running containers
INFO[0000] First run: 2018-09-03 17:02:53 +0000 UTC
DEBU[0299] Checking containers for updated images
DEBU[0299] Retrieving running containers
DEBU[0299] Pulling nodered/node-red-docker:slim-v8 for /node-red
DEBU[0299] No credentials for nodered in /config.json
DEBU[0299] No authentication credentials found for nodered/node-red-docker:slim-v8
DEBU[0299] No new images found for /node-red

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 2
  • Comments: 17 (6 by maintainers)

Most upvoted comments

There was another post about just building an image; which is what I did

FROM golang:alpine as builder
RUN apk update && apk add  alpine-sdk ca-certificates tzdata
RUN curl https://glide.sh/get | sh

RUN go get github.com/v2tec/watchtower; exit 0

WORKDIR /go/src/github.com/v2tec/watchtower

RUN glide install

RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo .

FROM scratch

LABEL "com.centurylinklabs.watchtower"="true"

COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo
COPY --from=builder /go/src/github.com/v2tec/watchtower/watchtower /watchtower

ENTRYPOINT ["/watchtower"] 

I was still experiencing this until I realised I was using v2tec/watchtower and not containrrr/watchtower so now this feature is working nicely!

Would be great if a new image could be pushed. It’s a little confusing for anyone trying to use labels 😃

#222

it seems that fixes the issue, I haven’t faced this issue since. Thanks!

I’ve created a simple docker container using the current watchtower version from github: https://hub.docker.com/r/svengo/watchtower/. You can find the Dockerfile on github.

I should add a README…

@opelx can you double-check the compose label syntax?

According to docker-compose labels docs, the following syntaxes are accepted:

labels:
    com.example.description: "Accounting webapp"
    com.example.department: "Finance"
    com.example.label-with-empty-value: ""

or

labels:
    - "com.example.description=Accounting webapp"
    - "com.example.department=Finance"
    - "com.example.label-with-empty-value"

Maybe wrapping com.centurylinklabs.watchtower.enable=false up with quotes might solve the issue.

Let me know if the problem persists xD

Just discovered this – interesting there hasn’t been an update in 4 months…