Docker service update and docker stack stack with existing stack

I have doubts about using docker swimming mode commands to update existing services after deploying a set of services with docker stack deploy. As I understand it, each service is tied to the SHA256 digest of the image at the time of creation, so if you rebuild and click on the image (with the same tag) and try to start docker service update, the service image is not updated (even if SHA256 is different). On the contrary, if you start again docker stack deploy, all services will be updated with new images. I was able to update the service image using docker service update --image repository/image:tag <service>. Is this the normal behavior of these commands, or is there something I didn't understand?

I am using Docker 17.03.1-ce

+3
source share
2 answers

Deploying the docker stack, the documentation says: "Create and update the stack from the compose or dab file on the swarm. This command should be run targeting the node manager." So the behavior that you described is as expected.

Updating the Docker service, the documentation is not so clear, but you yourself said that it only works with --image repository/image:tag <service>, so the flag needs to be updated capaciously.

You have two ways to accomplish what you want.

0
source

This is normal and expected behavior for docker stack deployupdating images of existing services to any hash associated with the specified tag.

, latest - , latest , , .

0

All Articles