Enter container to view IP
root@f2b5cdfdc5ed:/private-geth# IP addr
1:lo: <LOOPBACK,UP,LOWER_UP> MTU 65536 qdisc noqueue State UNKNOWN GR OUP default Qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet
127.0.0.1/8 scope host lo
Valid_lft Forever Preferred_lft Forever
Inet6:: 1/128 scope host
valid_lft
forever Preferred_lft Forever 273:eth0@if274: <BROADCAST,MULTICAST,UP,LOWER_UP> MTU Qdisc noqueue State up Group default
link/ether 02: 42:ac:12:00:04 BRD ff:ff:ff:ff:ff:ff link-netnsid 0
inet 172.18.0.4/16 scope global eth0 valid_lft
Forever Preferred_lft Forever
inet6 fe80::42:acff:fe12:4/64 scope link
valid_lft forever preferred_lft Forever
Ping in another container
root@03fb89fa98ec:/# Ping 172.18.0.4
ping 172.18.0.4 (172.18.0.4) bytes of data.
Bytes from 172.18.0.4:icmp_seq=1 ttl=64 time=0.166 ms to
bytes from 172.18.0.4:icmp_seq=2 ttl=64 time=0.137 ms
64 bytes from 172.18.0.4:icmp_seq=3 ttl=64 time=0.103 ms to
bytes from 172.18.0.4:icmp_seq=4 ttl=64 time=0.109 ms< c5/>64 bytes from 172.18.0.4:icmp_seq=5 ttl=64 time=0.109 ms to
bytes from 172.18.0.4:icmp_seq=6 ttl=64 time=0.135 m S-
bytes from 172.18.0.4:icmp_seq=7 ttl=64 time=0.123 ms-
bytes from 172.18.0.4:icmp_seq=8 ttl=64 time=0.109 Ms
bytes from 172.18.0.4:icmp_seq=9 ttl=64 time=0.110 Ms
^c
It's OK.