You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 17, 2025. It is now read-only.
Repository navigation
This repository was archived by the owner on Dec 17, 2025. It is now read-only.
I don't know if you can do this or now, but I'd like to be able to specify the docker compose defined container name to watch, then have it do a rolling update on that. I could do this is regex matching or something, but I don't believe that's implemented. We can discuss this more more if you're interested.
Reacted by Dima Merkurev, David Gidwani, David Noyes, Oliver Steensen-Bech Haagh, Michael Freund, Jacob Tomlinson, Faheem Nadeem, Tobias Bradtke, Benjamin Grima, Sami Haahtinen and 29 more
Like this only the containers watchtower, nginx, nginx-gen and pmawill be automatically updated.
Cheers
Reacted by Tema Smirnov, Gaurav Sharma, Matt Dotson, Haukur Kristinsson, Stepan Usatiuk, Amit Kumar, Daniel Flannery, Happyfeet01, Trey Yoder, David Kowis and 14 more
Reacted by RavianXReaver and Andrew
Reacted by Tema Smirnov, Haukur Kristinsson, Patrick, Happyfeet01, RavianXReaver, Joseph Benedettini and Andrew
@shyd docker-compose is creating container with a "custom" name (based on the current repository for example)
What @7imbrook wanted to do, is a way to "support" this custom name with watchtower, like putting a regexp instead of a container name for example.
where ./etc/watchtower/config.json is a copy of the ~/.docker/config.json authentication configuration created after logging in to a registry with docker login registry.example.com.
Reacted by Patrick, Amit Kumar, Kristaps Vītoliņš, Wildan Zulfikar, Patrik Kernstock, Simon Aronsson, David Kowis, agilob, Lonli-Lokli, Samuel Philipp and 6 more
Reacted by Damien Allen, Christian Hase, Vivek Malvi and Cristian Miranda
My question is regard to observing a docker-compose.yml file for changes. Is there support for watchtower to observe changes to a set of services in a defined docker-compose.yml with watch tower running separately?
And then the file docker-compose.yml file is then observed for changes, and upon detected is re-started? (For example with docker-compose down && docker-compose up -d). Changes could occur independently via git-hooks, for example.
The purpose of this is to enables greater control of the container parameters instead of simply updating the container itself. In the example below, this would allow the addition (and/or removal) of container parameters, such as the commands parameter, and the spawning of new containers, such as that defined by watchme2, if the following changes to the docker-compose.yml were to occur:
@7imbrook
what you're asking for is best resolved using enable labels, as pointed out in previous responses.
@nderjung
That's a great feature request. Unsure whether it would fit within the scope for watchtower however.
Any suggestions on how we would go about doing this in practice? Maybe a two step solution where we first check the hash of the file and; in case it differs from the last seen; parse the yml for the actual changes? I guess you'd also like to use docker labels to tell watchtower whether a specific container should be automatically recreated or not?
the main question has been answered by @nderjung. if a compose file change trigger is still wanted, feel free to open up a new issue about that and/or provide a pull request implementing said feature.
Activity
shyd commentedon Jul 24, 2017
Hi,
I successfully integrated watchtower into docker compose by specifying containers in the
commandsection like this:Like this only the containers
watchtower,nginx,nginx-genandpmawill be automatically updated.Cheers
olivierHa commentedon Oct 25, 2017
@shyd docker-compose is creating container with a "custom" name (based on the current repository for example)
What @7imbrook wanted to do, is a way to "support" this custom name with watchtower, like putting a regexp instead of a container name for example.
nderjung commentedon Jan 8, 2018
I had success with watchtower observing containers defined within a
docker-compose.ymlcontext by enabling the--label-enableflag. Here's an example:where
./etc/watchtower/config.jsonis a copy of the~/.docker/config.jsonauthentication configuration created after logging in to a registry withdocker login registry.example.com.nderjung commentedon Jan 8, 2018
My question is regard to observing a
docker-compose.ymlfile for changes. Is there support for watchtower to observe changes to a set of services in a defineddocker-compose.ymlwith watch tower running separately?For instance, if watchtower is spawned with:
And then the file
docker-compose.ymlfile is then observed for changes, and upon detected is re-started? (For example withdocker-compose down && docker-compose up -d). Changes could occur independently via git-hooks, for example.The purpose of this is to enables greater control of the container parameters instead of simply updating the container itself. In the example below, this would allow the addition (and/or removal) of container parameters, such as the
commandsparameter, and the spawning of new containers, such as that defined bywatchme2, if the following changes to thedocker-compose.ymlwere to occur:services: watchme: container_name: 'watchme' image: registry.example.com/watchme:latest restart: always + commands: --this-is-my-app-flag volumes: - watchme-data:/data + watchme2: + container_name: 'watchme2' + image: registry.example.com/watchme2:latest + restart: alwaysnderjung commentedon Jan 8, 2018
cc @stffabi @bdehamer
simonaronsson commentedon Apr 1, 2019
@7imbrook
what you're asking for is best resolved using enable labels, as pointed out in previous responses.
@nderjung
That's a great feature request. Unsure whether it would fit within the scope for watchtower however.
Any suggestions on how we would go about doing this in practice? Maybe a two step solution where we first check the hash of the file and; in case it differs from the last seen; parse the yml for the actual changes? I guess you'd also like to use docker labels to tell watchtower whether a specific container should be automatically recreated or not?
🙏
simonaronsson commentedon May 12, 2019
the main question has been answered by @nderjung. if a compose file change trigger is still wanted, feel free to open up a new issue about that and/or provide a pull request implementing said feature.