Reputation: 12107
I have a whole system started with docker compose.
It is made of a few containers and also contains info regarding the connectivity.
For example:
librarian:
image: autobot-librarian
ports:
- 4000:80
depends_on:
- mongodb
links:
- mongodb
In this case, this container can access mongodb.
I would like to be able to update the image of a single container and replace it on the fly, without shutting down the whole system.
I can stop a container, and restart it with a new image, but the connectivity established by docker-compose is not present anymore.
Is there a way around this?
Upvotes: 1
Views: 105
Reputation: 2259
You can use docker-compose
to manage one or more service at time. In this case, if you want to update one image you have to do:
docker-compose pull librarian
After that, if you want update the container:
docker-compose up -d librarian
This only restart one service and all the services that depend on it (defined in the docker-compose as depends_on
).
Upvotes: 1