简体   繁体   中英

Local development and swarm service image update

We are using Docker Swarm on developers machines for development. Docker services is using eg foo:beta image.

When a developer builds a new feature for foo , he builds a new image of the container locally, under the same name (sha is different).

However, we are not being able to update the service to use the new image version. We tried

docker service update --force --image <component>

w/o success.

We are running the latest edge docker build: 17.05.0-ce-rc1-mac8 (16582)

The key is to use a local tag for images, that does not exist on remote repository. When Swarm can't find the image by given tag on remote repo, it will use the local one.

For that purpose, we tag all developer-related containers also with eg dev tag, that only exist on developers machine. This way we can update the image and by forcing the service update, update the running code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM