I run a specific docker image for the first time:
docker run [OPTIONS] image [CMD]
Some of the options I supply include --link
(link with other containers) and -p
(expose ports)
I noticed that if I kill that container and simply do docker start <container-id>
, Docker honors all the options that I specified during the run
command including the links and ports.
Is this behavior explicitly documented and can I always count on the start
command to reincarnate the container with all the options I supplied in the run
command?
Also, I noticed that killing/starting a container which is linked to another container updates the upstream container's /etc/hosts
file automatically:
A--(link)-->B
(A has an entry in /etc/hosts
for B)
If I kill
B, B will normally get a new IP address. I notice that when i start
B, the entry for B in A's /etc/hosts
file is automatically updated... This is very nice.
I read here that --link
does not handle container restarts... Has this been updated recently? If not, why am I seeing this behavior?
(Im using Docker version 1.7.1, build 786b29d)