I’m sure this has come up before so sorry for duplicates I’m still new to Docker. I’ve been experimenting with it for a few months and generally speaking its going well. I have run into an issues however.
Setup is a basic wired\wireless network. Ubuntu server running wired to the network and Docker running on the Ubuntu HOST. Internally the containers talk to each other on the bridge network and use the HOST IP (192.168.0.99 in my case) for “external” connectivity. From what I am reading this is all normal so far.
I have encountered a case where a container needs a port to be open to accept incoming requests (this port cannot be changed as its an industry used port like 25 for SMTP or 53 for DNS).
However the HOST machine (in this case Ubuntu) is also using this port so the container wont start. I need to keep the port on the HOST. I first thought I might be able to assign the container an IP in a new bridge network or by the IP its assigned on the default bridge network. From what I am reading it sounds like even though the HOST O\S is assigned the default GW IP for that bridge network its only accessible from within the bridge network. i.e. I cant ping the GW IP or the bridge IP’s from a machine on my physical network.
I tried running the container with HOST network but this just seems to use the HOST IP similar to bridge with port mapping.
I also run into a problem where I want to run 2 containers (using HOST IP is fine) however the service on these two containers require the same port.
Is there anyway to give a contain an IP from my wired network e.g. 192.168.0.100