如何在对接-组合中为某些码头添加多个主机名?容器应该自己看到许多主机名,例如:
ping name: should resolve 127.0.0.1 (or $docker_ip)
ping another.name: should resolve 127.0.0.1 (or $docker_ip)发布于 2016-10-05 10:01:17
使用额外主机
extra_hosts:
- "name:127.0.0.1"
- "another.name:127.0.0.1"具有与docker run --add-host相同的效果
> docker run --add-host another.name:127.0.0.1 sixeyed/ubuntu-with-utils ping another.name
PING another.name (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.057 mshttps://stackoverflow.com/questions/39869962
复制相似问题