Port forwarding Ubuntu – Docker

I have following problem:

Assume that I started two Docker containers on host machine: A and B.

  • How to add user with dockerfile?
  • Docker LVM support
  • jax-rs client is not creating jax-rs cookie
  • Docker for Windows 10 //./pipe/docker_engine: access is denied
  • Docker in docker on AWS Elastic Beanstalk
  • How to recover a stopped docker container which ran out of space?
  • docker run A -ti -p 2000:2000
    docker run B -ti -p 2001:2001

    I want to be able to get to each of this containers FROM INTERNET by:

    • http://example.com:2000
    • http://example.com:2001

    How to reach that?

  • Diff docker registry images
  • Docker: effect of logging driver on logs
  • Kubernetes - Automatically populating CloudDNS records from service endpoints
  • How do i wait for a db container to be up before my spring-boot app starts
  • How to create an overlay network with Docker?
  • docker hub webhook for _failed_ build?
  • One Solution collect form web for “Port forwarding Ubuntu – Docker”

    The rest of the equation here is just normal TCP / IP flow. You’ll need to make sure of the following:

    • If the host has some an implicit deny for incoming traffic on its physical interface, you will need to open up ports 2000 and 2001, just like you would for any service (Docker or not).
    • If the host is behind a NAT or other external means of routing, you’ll need to punch holes for those ports there as well.
    • You’ll need the external IP address (either the one attached to the host or the one in front of the NAT allowing access to the ports).

    As far as Docker is concerned, you’ve done what is required to open the ports to the service running in that container correctly.

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