How to update docker container automatically with Watchtower. Scheduled updates without downtime for your entire docker environment.
We will use the free and open-source software Watchtower.
Project Homepage: https://containrrr.dev/watchtower/
Video: https://youtu.be/5lP_pdjcVMo
- Linux Server running Docker
Watchtower can be easily deployed by executing a simple docker run command.
docker run --name watchtower -v /var/run/docker.sock:/var/run/docker.sock containrrr/watchtower
You might wonder why there is no log output apart from the welcome message. If you want to increase the logging level or watchtower, you simply just add an argument.
docker run --name watchtower -v /var/run/docker.sock:/var/run/docker.sock containrrr/watchtower --debug
docker run --name watchtower -v /var/run/docker.sock:/var/run/docker.sock containrrr/watchtower --run-once --debug
docker run -d --label=com.centurylinklabs.watchtower.enable= false nginx
docker run --name watchtower -v /var/run/docker.sock:/var/run/docker.sock --restart unless-stopped containrrr/watchtower --schedule "0 0 4 * * *" --debug --cleanup