link是單方向的,只有先起一個(gè)容器,其他容器才能link
docker run -d -it --name db01 alpine:latest
docker run -it --link db01:mysql alpine:latest
/ # ping db01
PING db01 (172.17.0.2): 56 data bytes
64 bytes from 172.17.0.2: seq=0 ttl=64 time=0.151 ms
64 bytes from 172.17.0.2: seq=1 ttl=64 time=0.083 ms