Docker Community Forums

Share and learn in the Docker community.

No ip adress assigned to containers

I have a CentOS 7 host that’s is running in a VMware machine. Using the docker version 1.12.6. The problem is that the containers do not get assigned IP address. The ifconfig on the host shows the following:

docker0   Link encap:Ethernet  HWaddr 02:42:ea:b8:aa:3f  
          inet addr:172.17.0.1  Bcast:0.0.0.0  Mask:255.255.0.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

eno17777989 Link encap:Ethernet  HWaddr 00:50:56:84:66:11  
          inet addr:185.156.62.21  Bcast:185.156.62.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:63003 errors:0 dropped:0 overruns:0 frame:0
          TX packets:59717 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:40357425 (40.3 MB)  TX bytes:48146460 (48.1 MB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:430 errors:0 dropped:0 overruns:0 frame:0
          TX packets:430 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:21588 (21.5 KB)  TX bytes:21588 (21.5 KB)

I start a container using the command below:
docker run --name foo -d -it --net=host bar:latest

The inspect command shows the following snippet about Network:

"Networks": {
                "host": {
                    "IPAMConfig": null,
                    "Links": null,
                    "Aliases": null,
                    "NetworkID": "c90ed1c74fc7ab7bb74f0e4e86abd81cd6369d568b3d656cbafbf082e4927eb",
                    "EndpointID": "cd5e1382031dc4af37f638fdfbf30e1e5ad56e6f938f3b23bf47426522876f9a",
                    "Gateway": "",
                    "IPAddress": "",
                    "IPPrefixLen": 0,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "MacAddress": ""
                }
            }

I have some weird behavior in the running container. The container has some Web server running and that Web server does respond to Get requests quickly but the first Post request takes several minutes.

Can’t see any error in the daemon’s logs. Any tips?