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?

  • Why am i forced to run docker with sudo on OS X?
  • Docker cannot create a machine - Error in driver during machine creation
  • docker image for a go package
  • How to docker exec to IBM bluemix containers
  • Ethercalc not launching on Docker and c9.io
  • How to create a superuser in Django with Linux shell script?
  • Bidirectionnal Sync with shell/terminal and actual code in Codenvy
  • Docker, Cannot connect to the Docker daemon. Is the docker daemon running on this host?
  • Docker DNS settings
  • Docker in host mode cannot connect to database running on host
  • “Error response from daemon: Cannot start container … no such file or directory” on Oracle Linux running hello-world
  • When does a running Docker container run out of disk space?
  • 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.