Watchtower
Overview
Auto-update for docker container
Install
- As first try, you could run with docker run file like this:
docker run -d \
--name watchtower \
-v /var/run/docker.sock:/var/run/docker.sock \
containrrr/watchtower
or simple docker compose
version: "3"
services:
watchtower:
image: containrrr/watchtower
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- By default, the watchtower only check every 24 hours, we could change it to be more frequent by adding extra command
--interval
version: "3"
services:
watchtower:
image: containrrr/watchtower
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /root/.docker/config.json:/config.json
command: --interval 30
There are many options to run that you could see here (opens in a new tab)
- As example of the result, these are the logs that watchtower produce
Notes
Auto-update only working in the same tags or using another alias version like 2.3
to deploy 2.3.1
, 2.3.2
, ... Ref (opens in a new tab). But it does not work due to docker could not find 2.3.1
through 2.3
. So, best way to do is keep the tag in latest
.