Watchtower: Multiple running watchtower instances

Created on 20 Mar 2020  路  7Comments  路  Source: containrrr/watchtower

Describe the bug

I am implementing watchtower and I would like to know how I can do my
case of use.

I have 2 types of containers: [image]:test and [image]:prod.

I would like the containers with tag test to be updated every 5 minutes. And the containers with tag prod through a schedule at 5am.

After studying it, I have decided to implement 2 watchtower:

  • The first with name watchtower-test with args:
    --cleanup --tlsverify --interval 300 --label-enable
    聽- The second with name watchtower-prod with args:
    --cleanup --tlsverify --schedule "0 0 5 * * *"

And add to [image]:test containers the label:
com.centurylinklabs.watchtower.enable = true

But I just realized that there cannot be 2 active watchtower containers.
see code

Could this deletion be parameterized?
Is there another possible solution? What do you think?

To Reproduce

$ docker run -d --name watchtower-prod --label com.centurylinklabs.watchtower.enable=false -v /var/run/docker.sock:/var/run/docker.sock containrrr/watchtower:0.3.10
[some_id1]

$ docker run -d --name watchtower-test --label com.centurylinklabs.watchtower.enable=false -v /var/run/docker.sock:/var/run/docker.sock containrrr/watchtower:0.3.10
[some_id2]

$ docker ps --all --quiet --filter name='watchtower$'|wc -l
1

Regards,

Do not close Medium Available Help Needed Enhancement

Most helpful comment

I can try to implement the WATCHTOWER_SCOPE_UID approach

All 7 comments

Hi there! 馃憢馃徏 As you're new to this repo, we'd like to suggest that you read our code of conduct as well as our contribution guidelines. Thanks a bunch for opening your first issue! 馃檹

I just reasoned around something very similar to what you're trying to achieve (although that user had a completely different goal) in #440. By adding a WATCHTOWER_SCOPE_UID env var, we could allow for multiple watchtower instances, as each would only kill other instances with the same scope uid.

Unfortunately, I don't really have time to implement this change at this point, so if you'd like to have a go at it, it would be awesome. I would of course aid as much as possible with reviews, cheers and cookies! 馃槄

I can try to implement the WATCHTOWER_SCOPE_UID approach

Hi @victorcmoura that would be great. The truth is that I have never programmed in GO, so it would be very helpful.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

To avoid important communication to get lost in a closed issues no one monitors, I'll go ahead and lock this issue. If you want to continue the discussion, please open a new issue. Thank you! 馃檹馃徏

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dsteinkopf picture dsteinkopf  路  5Comments

MakerTim picture MakerTim  路  6Comments

darox picture darox  路  5Comments

Fredrik81 picture Fredrik81  路  5Comments

aogg picture aogg  路  3Comments