Docker Compose File For Watchtower
Category : Docker Compose Files
Watchtower is a docker container that will update the version of other running containers. You can change the environment settings as required for your installation – see the full documentation for more info.
version: '3' services: watchtower: image: containrrr/watchtower volumes: - /var/run/docker.sock:/var/run/docker.sock - /etc/timezone:/etc/timezone:ro environment: - WATCHTOWER_CLEANUP=true - WATCHTOWER_LABEL_ENABLE=true - WATCHTOWER_INCLUDE_RESTARTING=true
Create a new directory and save the above file inside it as docker-compose.yml.
mkdir watchtower cd watchtower vi docker-compose.yml
Run docker-compose up -d to fetch the image from the docker hub and create your Watchtower instance. You’ll need to add labels to your docker containers that you’d like to update which will be covered in another blog post.