Port forwarding Ubuntu – Docker

I have following problem:

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

  • Why shouldn't I run multiple processes in a Docker container?
  • Docker-Compose Up Works but Eb Local Run does not
  • Installation of Kubernetes-node fails with conflicting packages on CentOs 7
  • Can FreeBSD be run inside Docker?
  • Clone private git repo with dockerfile
  • Django Cookiecutter how do i change the production media storage to local
  • 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?

  • “Error response from daemon: Cannot start container … no such file or directory” on Oracle Linux running hello-world
  • Docker error : no space left on device
  • DC/OS schedule container updates
  • What's the best practice for including a .env file in a jenkins build?
  • Docker: Monitor logical units of linked containers
  • appSettings.json for .NET Core app in Docker?
  • 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.