Hello, whatever container I run, it seems that container network ports communication is blocked.
I tried with portainer and nginx, also a ruby http server, impossible to reach container from host.
Example with nginx :
docker run -d -p 7878:80 --rm --name webserver nginx
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
08cdc8400686 nginx "nginx -g 'daemon of…" 4 seconds ago Up 3 seconds 0.0.0.0:7878-80/tcp webserver
docker inspect 08cdc8400686 | grep IPAddress "SecondaryIPAddresses": null, "IPAddress": "172.17.0.2", "IPAddress": "172.17.0.2",
So basically, nginx port 80 is exposed, and at host level it’s reachable at port 7878 … it should.
But when I test connection from localhost :
telnet localhost 7878 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. ### connection OK telnet 172.17.0.2 80 Trying 172.17.0.2... ^] ### connection KO
It seems that forwarding to bridge works, but IP or port of container is blocked. I could ICMP network bridge gateway but not the container drive me crazy !!
ping 172.17.0.2 PING 172.17.0.2 (172.17.0.2) 56(84) bytes of data. ping: sendmsg: Operation not permitted ping 172.17.0.1 PING 172.17.0.1 (172.17.0.1) 56(84) bytes of data. 64 bytes from 172.17.0.1: icmp_seq=1 ttl=64 time=0.141 ms
I reinstall docker-ce on my Ubuntu Xenial laptop but it did not solve this problem.
Is this a common problem ? I googled all afternoon yesterday without success, even with playing with iptables
Someone has an idea to help ?