Cannot reach web server inside Docker

I’m doing some recapitulation of my Docker knowledge but have run into a problem that I don’t understand.

I created a simple web server in Go and have no problems running it inside a Docker container. But I cannot reach it from outside.

  • TCP/UDP packets not reaching docker container
  • Is it possible to have a Supervisord pretask?
  • docker add cache when git checkout same file
  • Docker error resolve host and I/O error on POST request for http://es.example/oauth/check_token Connection refused
  • How can I use a variable inside a Dockerfile CMD?
  • How to create Dockerfile which installs Python 3 and nltk in a Ubuntu container?
  • Since I thought that perhaps something is blocking access to Docker containers, I tried running an SSHd container. That works fine; I can reach it and log in using SSH.

    You can see my Dockerfile and my small Go code in this gist:

    Why can’t I reach the small web server?

  • How to use Docker to make releases?
  • How to inspect a running Docker container
  • output file after docker image is created through Dockerfile
  • How to make Docker to avoid V1 registry
  • Docker rails run server
  • Gitlab runner: Use own (exiting) docker container
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.