Empty response from server running inside Docker container

I have a Docker container on my laptop that contains a server. The server is running at localhost:9000. I configured port forwarding between my laptop and virtual machine as follows:

VBoxManage modifyvm "default" --natpf1 "tcp-port9000,tcp,,9000,,9000";

Now I am trying to start the container as follows:

docker run -p 9000:9000 -t -i my-image

But when I try to connect, I get the following error:

$ curl localhost:9000                                                   
> curl: (52) Empty reply from server

Looking at the logs of my server, the request never makes it there, so something else should be wrong. How can I diagnose this problem?

+4
source share

Source: https://habr.com/ru/post/1615446/


All Articles