Understanding docker port mappings

Please explain the following output:

docker ps ExanpleContainter

Ports
--------
10.10.10.10:443->443/tcp, 0.0.0.0:1937->1937/tcp

And,

  • Use multiple images in Dockerfile
  • OSX / Mac with Kitematic / Docker : Tunnel / Port forwarding for access via external url
  • Docker 1.9: Adding --link target to a running nginx container
  • Connecting to a USB Android Device in a Docker Container via adb
  • Forward Ports from boot2docker using the Vagrant Docker provider
  • Configuration issue in nginx of docker - Troubleshooting docker with no instaces
  • docker inspect ExanpleContainter
    
    "Ports": {
                    "1937/tcp": [
                        {
                            "HostIp": "0.0.0.0",
                            "HostPort": "1937"
                        }
                    ],
                    "443/tcp": [
                        {
                            "HostIp": "10.10.10.10",
                            "HostPort": "443"
                        }
                    ]
    

    I’d want to understand how mapping is done and which port is mapped where?

  • OSX Docker/WordPress/MySQL — Connection Error: (1130) Host 'xxx.xxx.xxx.xxx' is not allowed to connect to this MariaDB server
  • Сan not run the simple docker container
  • Mysql in container or different VM
  • How is Docker different from a normal OS process?
  • Is it possible to use Kubernetes for Gitlab build runners and how?
  • When running Docker on Raspberry Pi starting containers fails from time to time
  • One Solution collect form web for “Understanding docker port mappings”

    10.10.10.10:443->443/tcp

    This means docker host IP 10.10.10.10 on port 443 is mapped to specified container on port 443. packets arriving at that ip port combination will be accessible in the container on the same port (443)

    0.0.0.0:1937->1937/tcp

    Packets arriving on all available IP addresses (0.0.0.0) on docker host on port 1937 are accessible on specified container on the same port (1937)

    Read explanation in the answer and compare it to output of docker inspect ExanpleContainter.

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