I\'ve been trying to figure this out in the last hours but I\'m stuck.
I have a very simple Dockerfile which looks like this:
FROM alpine:3.6
COPY gempbo
Another possibility why you are getting that error is that the docker run command is run through a normal cmd prompt and not the admin command prompt. Make sure you run as an admin!
Your issue is that you are binding to the 127.0.0.1:8025
inside your code. This makes the code work from inside the container but not outside.
You need to bind to 0.0.0.0:8025
to bind to all interfaces inside the container. So traffic coming from outside of the container is also accepted by your Go app
Adding to the accepted answer: I had the same error message trying to run docker/getting-started.
The problem was that "getting-started" is using port 80 and this was
"occupied" (netsh http show urlacl
) on my machine.
I had to use docker run -d -p 8888:80 docker/getting-started
where
8888 was an unused port. And then open "http://localhost:8888/tutorial/".