A simple way to update all your docker containers with watchtower
Watchtower is a docker container, which can help you with updating your docker containers without a complicates process.
Simply run the following command, to create your Watchtower container and
1
2
3
4
5
docker create \
--network host \
--name watchtower-once \
-v /var/run/docker.sock:/var/run/docker.sock \
containrrr/watchtower:latest --cleanup --include-stopped --run-once
And to start it run this command:
1
docker start watchtower-once -i
By running this command the Watchtower container will check for updated images for al of your docker containers and it will pull all updated images. Therefor it will stop running containers, which need to be updated, then it will update them and start them again. Stopped containers will also be updated, but not started after updating.