Docker container

I would like to be able to update the container without reloading all the other containers associated with it.

According to this https://docs.docker.com/userguide/dockerlinks/#container-linking

If you restart the source container, the associated containers / etc / hosts files will be automatically updated with the new IP address, the source address, allowing communication to continue.

Sounds great, but I don't want to just restart. I need to upgrade to a newer version. And its not working.

Let's look at this example from the article above:

sudo docker run -d --name db training/postgres

sudo docker run -t -i --rm --link db:db training/webapp /bin/bash
cat /etc/hosts

Reload the db container:

sudo docker restart db

and inside the current cat / etc / hosts container the new IP address for db will be displayed .

But I want:

sudo docker stop db
sudo docker rm db
sudo docker run -d --name db training/postgres:new_version

cat/etc/hosts ip- db. .

?

, , .

+4

All Articles