Docker Swarm Service - force update of latest image already running
Docker won't automatically perform a pull from DockerHub (or private registry) for an image:tag you already have locally.
If you performed a manual pull before the docker service update
, or deleted the image locally, it would.
You could also chain the command:
docker pull image:tag && docker service update --image username/imagename:latest servicename
You can avoid this scenario by tagging your images numerically and using an updated tag. username/imagename:1.1.0
Just for future reference:
Docker 1.13 added a --force
flag to service update
:
--force
: Force update even if no changes require it
Use it as in:
docker service update --force service_name