1

I try to expose a docker container to the outside world (well, to be specific just in my internal network - 10.0.0.0/24) with a static ip adress. In my example the container should have the IP address 10.0.0.200.

Docker version is 1.10.3.

Therefore i created a userdefined network: docker network create --subnet 10.0.0.0/24 --gateway 10.0.0.254 dn in bridge mode.

Then i created a container and attached it to the container.

docker run -d \ --name testhost \ -it \ -h testhost \ --net dn \ --ip 10.0.0.200 \ -p 8080:8080 \ some image

The container has the correct ip and gw assigned (10.0.0.200, 10.0.0.254 - which is also the ip from the docker created bridge interface) but no communication from the container to the outside world nor from the outside to the container is possible. only thing that works is nslookup but tbh i dont know why this is working.

From another host in the network i can ping the bridge interface which was created through the docker network create command.

A second container connected the the dn network can ping my first container. so communication inside the network seems fine.

As in the docker [network documentation][1]

[1]: https://docs.docker.com/engine/userguide/networking/#a-bridge-network "docker network docu" (second picture in bridge network) it should be possible

It seems that im missing some step or config. Any advice is appreciated, thank you.

0 Answers0