Skip to main content

Update Docker container image with Watchtower

Written by Andzej Korkuz
Updated today

Automatically update Docker container image with Watchtower

Watchtower works both with Docker’s run command and Docker Compose to automatically update a Docker image. Both methods are functionally the same in creating a container running Watchtower, then pointing it towards a container you wish to keep automatically updated. In our case, we will be monitoring Myst container only.

By default Watchtower polls your repository for image updates every 86400 seconds, or 24 hours. This interval can be changed with the --interval flag or WATCHTOWER_POLL_INTERVAL environment variable. It accepts a value in seconds. In the below example, we have increased it to 259200 seconds, or 72 hours time interval:

docker run -d --name watchtower -e WATCHTOWER_POLL_INTERVAL=259200 -v /var/run/docker.sock:/var/run/docker.sock containrrr/watchtower myst
Did this answer your question?