doker网络
单向连接 --link
docker run -d --name centos-test-1
[ ~]# docker run -d --name centos-test-1 centos ping 114.114.114.114 bd4aa8b35c8d6e85dbf653574368ef2e2062648398ca36a1d8bcfdf4fb32ee91
[ ~]# docker run -d --name centos-test-2 --link centos-test-1 centos ping 114.114.114.114 4157e80f41850bf5babfc264d6d049ed51faa2d6a851b402532817eb6cc754e1
[ ~]# docker exec -it centos-test-2 bash [ /]# ping centos-test-1 PING centos-test-1 (172.17.0.5) 56(84) bytes of data. 64 bytes from centos-test-1 (172.17.0.5): icmp_seq=1 ttl=64 time=0.113 ms 64 bytes from centos-test-1 (172.17.0.5): icmp_seq=2 ttl=64 time=0.168 ms ^C --- centos-test-1 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1000ms rtt min/avg/max/mdev = 0.113/0.140/0.168/0.029 ms [ /]#
[ /]# ping centos-test-2 ping: centos-test-2: Name or service not known [ /]#
相关推荐
txj 2020-09-08
travelinrain 2020-07-27
higheels 2020-07-27
wq0 2020-07-18
Jieen 2020-07-08
luobotoutou 2020-06-16
屿刃 2020-06-14
TinyDolphin 2020-06-13
大老张学编程 2020-06-12
kenson 2020-06-08
PlayerL 2020-06-03
LeoHan 2020-05-31
wenjs00 2020-05-29
comeonxueRong 2020-05-17
furongwei 2020-05-04
BingGoGo技术 2020-04-07
wanggongzhen 2020-03-27
89284553 2020-03-23