0

Apologies if this obvious - I can't seem to figure this out. I have a docker container with ports 8112 exposed to the host. Docker ps shows: ' 0.0.0.0:8112->8112/tcp '

From the host, I can successfully connect to the port using localhost: ' curl localhost:8112 **This works '

From the host or remote machine, I cannot connect via ip: ' curl 192.168.0.5:8112 **This fails - just hangs and eventually timeouts '

I'm not sure how to diagnose from here - any help would be greatly appreciated!

2
  • tcpdump is the way to diagnose this, and perhaps netfilter's TRACE target.
    – womble
    Sep 30, 2019 at 2:54
  • Thank you - will read up on that. Is there anything I should be looking for specifically?
    – frootloop
    Oct 1, 2019 at 1:48

1 Answer 1

2

This is likely due to known limitations of Docker networking.

From the link: "Per-container IP addressing is not possible"

Link is for Mac, as that is what I use, but I think there may be a similar limitation with Docker for Windows.

This is likely why you are able to access the container from localhost, but not by its IP.

EDIT: This all applies to connecting to the container from the host, if you want to connect to it remotely there are a bunch of other factors like firewalls that have nothing to do with Docker and might prevent you from accessing.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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