Skip to main content

Watchtower

Configure Watchtower

Watchtower has various configuration options. You can customize its behavior by passing environment variables or command-line arguments.

Here’s an example of running Watchtower with a few additional options:

docker run -d \
  --name watchtower \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -e WATCHTOWER_CLEANUP=true \
  -e WATCHTOWER_POLL_INTERVAL=300 \
  containrrr/watchtower

WATCHTOWER_CLEANUP=true   instructs Watchtower to remove old images after updating.
WATCHTOWER_POLL_INTERVAL=300   sets the interval for checking updates to every 5 minutes (300 seconds).

Verify Watchtower

o ensure Watchtower is running correctly, you can check its logs:

docker logs watchtower

If everything is set up properly, you'll see logs indicating that Watchtower is checking for updates and managing your Docker containers.

Such as this:

root@test:~# docker logs watchtower
time="2024-06-02T05:45:43Z" level=info msg="Watchtower 1.7.1"
time="2024-06-02T05:45:43Z" level=info msg="Using no notifications"
time="2024-06-02T05:45:43Z" level=info msg="Checking all containers (except explicitly disabled with label)"
time="2024-06-02T05:45:43Z" level=info msg="Scheduling first run: 2024-06-02 05:50:43 +0000 UTC"
time="2024-06-02T05:45:43Z" level=info msg="Note that the first check will be performed in 4 minutes, 59 seconds"
time="2024-06-02T05:50:44Z" level=info msg="Session done" Failed=0 Scanned=2 Updated=0 notify=no
time="2024-06-02T05:52:24Z" level=info msg="Waiting for running update to be finished..."

Green.Ins0mniA