Problem: my server is already using port 80 and I would like launch another service that uses port 80 on another address (I don't want to remember ports or force my wife to use non-default ports).

I've created a secondary IP address for all of my dockers (the dockers themselves will only map their ports to one address) but my server grabs port 80 for the default service on both addresses.

Is there a docker way to create a second IP address and avoid this problem?



If you pass the listen address as the very first component of -p, Docker will only listen on that address:

$ docker run -p -d nginx`
$ ss -ltp | grep
LISTEN  0       4096*
| improve this answer | |
  • Hmm, what if I want to transmit on that port? – fcimeson Jun 29 at 21:51
  • You mean, outgoing with that IP? – thriqon Jun 30 at 9:37
  • Yes, outgoing with that IP. – fcimeson Jun 30 at 16:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.