Preparation --> follow the preparation steps in this [How-To]
in CLI:
- mkdir /home/docker1 create a folder for user docker1 in home directory (if not already done)
- mkdir /home/docker1/watchtower create a folder where we will put the docker-compose.yml file to setup watchtower
- cd /home/docker1/watchtower change in that directory
- nano docker-compose.yml create an empty file and start the editor
- copy the content of the Source Code box below in the editor and save the file with Ctrl+X and y; name must be "docker-compose.yml"
- to copy the content of the Source Code box use the small icon in the top right corner of the box ("Copy Contents")
Code
version: "2"
services:
watchtower:
image: containrrr/watchtower
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
- WATCHTOWER_CLEANUP=true
- WATCHTOWER_POLL_INTERVAL=3600
restart: unless-stopped
- after you saved the file, run docker-compose up -d in the directory where the docker-compose.yml file is located; this will download the needed image and start the container
You can also run the docker-compose file in Portainer without using the CLI:[How-To] Use docker-compose files in Portainer
For further details: https://containrrr.github.io/watchtower/
Q&A for my HOWTO: https://forum.openmediavault.o…V-and-docker-compose-Q-A/