Docker Community Forums

Share and learn in the Docker community.

How do I expose a container ip address to an external network

I’ve tried experimenting with various suggestions but nothing seems to work.

I have applications I need to run inside containers that require up to 15-20 tcp/udp ports. When running lots of these (in a qa/testing environment), it becomes unmanageable to expose all those ports using the normal docker bridge and natting the ports.

So I’d like to have each container assigned an ip address - so it is visible from an external network.

I’m running my engine on centos 7.3 with kernel 4.9.

Has anyone done this - and if so, please tell me how you did it.

Thank you,
Ian Collins

is service discovery an option for you?
such fixed ports / ips will every time stop you once you think about scaling and other issues.

Service discovery is potentially an option - however, I’ve been asked to implement an ip address solution.
Scaling isn’t an issue at present - and when they does present itself, the solution will probably change.

Any ideas on how to implement ip solution?