Docker: what is the equivalent of the legacy --link parameter -


i need connect db container server container. red legacy parameter --link, works perfect

$> docker run -d -p --name rethinkdb1 rethinkdb $> docker run -d --link rethinkdb:db my-server 

but, if parameter dropped eventually, how above ?

the docs says use docker network command instead (which available since docker 1.9.0 - 2015-11-03)

instead of

$> docker run -d -p --name rethinkdb rethinkdb $> docker run -d --link rethinkdb:rethinkdb my-server 

you use

$> docker network create --name my-network $> docker run -d -p --name rethinkdb1 --net=my-network rethinkdb $> docker run -d --net=my-network my-server 

note in new form, container names used, while before able define alias.

when 2 containers part of same network, /etc/hosts file updated can use container names instead of ip addresses.


Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -