Docker Community Forums

Share and learn in the Docker community.

+1 for allowing publicly accessible app ports


(Vipconsult) #1

I am developing payment processing app with few payment gateways which send webhooks/feedback for completed or failed payment.
I need to test if these webhooks are processed properly by the application so need to be able to allow 80 or any other port to accept these webhooks.


(Jeff Anderson) #2

What context is this in?

By default, docker containers have routes set up to get to whatever network your host can get to.


(Vipconsult) #3

Sorry I don’t understand .

I watched the docker meetup and they specifically mentions that you cannot set map ports from your host to a docker container.

so if the host ip is 192.168.0.11 and the docker runs on 192.168.64.2 and you have nginx on port 80
can you access nginx on 192.168.0.11:80 or just 192.168.64.2:80 ?


(Jeff Anderson) #4

When you run a docker container, you can specify the ip address it binds to on the host:

docker run -p 192.168.0.11:80:80 ...

This will bind to port 80 on the 192.168.0.11 ip address on the docker host, and forward its traffic to port 80 on the container.

If you omit the ip address, it will go to 0.0.0.0, which is an alias for “all ip addresses on the host”

That’s the behavior for the default docker0 network, as well as the bridge network driver anyway.


(Vipconsult) #5

I just realised I posted this in the wrong category.
moving to docker for mac