Can I force restart container even there is no newer docker image? #1587
-
Can I force restart container even there is no newer docker image? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
It depends on your situation... By "restart" I guess you mean "recreate", no? Otherwise you could just do
and then run watchtower. This causes it to think there is an update of the image and trigger a recreation using the new |
Beta Was this translation helpful? Give feedback.
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:
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…