Skip to content

Can I force restart container even there is no newer docker image? #1587

Closed Answered by piksel
tanpengsccd asked this question in Q&A
Discussion options

You must be logged in to vote

It depends on your situation... By "restart" I guess you mean "recreate", no? Otherwise you could just do docker restart <CONTAINER>.
If you want to "trick" watchtower to think a image has been updated, you can just tag your local image with an earlier version, so if the current (latest) version of nginx is v1.23.3, you could do:

$ docker tag nginx:1.22 nginx:latest

and then run watchtower. This causes it to think there is an update of the image and trigger a recreation using the new latest.
If you want to restart it because some other container is update it, you can put the com.centurylinklabs.watchtower.depends-on=/<OTHER-CONTAINER> label on it to have it be recreated whenever <OTHER-C…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by simskij
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants