Receiving http response inside a Docker container

I am running a process, process A, inside a Docker container that sends an HTTP reqeust to a process, process B, running natively on the host. Process B receives the request and after processing sends a response which process A does not receive. I believe this could be because I am not exposing the port on which the reply is sent. My understanding is that, this source port is randomly chosen and I am not sure how I can expose this port. Is there a way to overcome this issue?

  • Kitematic shows all docker images wrongly
  • What's a workable way setup an Akka cluster in a multi-node Docker environment?
  • register docker container to host network dns
  • error while setting file capabilities in Docker
  • Overriding `tcp.publish_port` breaks clustering when elasticsearch is in a container
  • ASP.NET Core - Issues while Debugging through Docker in Visual Studio 2015
  • How to have bash script answer interactive prompts (no y/n only)?
  • Docker Run and variable substitution
  • Assess is denied while docker save
  • docker: how to get veth bridge interface pair easily?
  • Lets encrypt failed authorization procedure - docker
  • How to connect docker container via ssh?
  • One Solution collect form web for “Receiving http response inside a Docker container”

    My understanding is that, this source port is randomly chosen and I am not sure how I can expose this port

    It is only if your container runs with the -P option.
    If you run with -p hostp_port:container_port option (with container_port being a port EXPOSE‘d in the Dockerfile of the image from which the container is running), that will work.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.