'Get "ERR_EMPTY_RESPONSE" when accessing localhost;114 mapped to docker container port

Trouble

Putting localhost:114,which is the host port mapped to the Docker container port, into the URL window of Chrome browser caused the error below:

このページは動作していませんlocalhost からデータが送信されませんでした。
ERR_EMPTY_RESPONSE

Environment

Docker Desktop on Windows/Windows 10 Home

Detail

For a practice for Docker, I'm trying to run some containers from Docker Image. In one trial, I tried the following.

docker run -d -p 114:514 --name yaju -v yajuHozon:/home/jovyan/work jupyter/datascience-notebook

and this is the container made.

CONTAINER ID   IMAGE                          COMMAND                  CREATED       STATUS       PORTS                            NAMES
b46b2b2a5ed1   jupyter/datascience-notebook   "tini -g -- start-no…"   6 hours ago   Up 6 hours   8888/tcp, 0.0.0.0:114->514/tcp   yaju

What is wrong?

Any information would be appreciated.

What worked tentatively

I tried to make other containers yaju2,yaju3,yaju4 with other port numbers assigned as follow:

CONTAINER ID   IMAGE                          COMMAND                  CREATED              STATUS              PORTS                              NAMES
cb2a9716bead   jupyter/datascience-notebook   "tini -g -- start-no…"   49 seconds ago       Up 47 seconds       8888/tcp, 0.0.0.0:8893->5000/tcp   yaju4
6c6f3b44846d   jupyter/datascience-notebook   "tini -g -- start-no…"   About a minute ago   Up About a minute   0.0.0.0:8889->8888/tcp             yaju3
5a470fc9e71f   jupyter/datascience-notebook   "tini -g -- start-no…"   3 minutes ago        Up 3 minutes        8888/tcp, 0.0.0.0:80->8080/tcp     yaju2
b46b2b2a5ed1   jupyter/datascience-notebook   "tini -g -- start-no…"   22 hours ago         Up 22 hours         8888/tcp, 0.0.0.0:114->514/tcp     yaju

Then, only yaju3 with 0.0.0.0:8889->8888/tcp worked and succeeded connecting container server. yaju2 with 8888/tcp, 0.0.0.0:80->8080/tcp and yaju4 with 8888/tcp, 0.0.0.0:8893->5000/tcp are also not working with ERR_EMPTY_RESPONSE. I guess that some port numbers are not suitable for using networking between Docker container and host OS, but I don't understand the detailed mechanisms.

Other what I tried

Stopped firewall

It appears that the firewall of ESET Endpoint Security sometimes does bad things for port issues so I turned it off, but the error still remains.

curl in Host

I tried curl command in host console and get an error below:

curl "http://localhost:114/"
curl: (52) Empty reply from server

curl in the container

I tried curl command in container to make it sure the server is running, but there was a error:

curl "http://localhost:514"
curl: (7) Failed to connect to localhost port 514 after 0 ms: Connection refused


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source