I used following command to create a nginx container.
$ docker run -it -d --name test-nginx -p 8090:8091 nginx
and it seems to be up and running fine
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e36f30ce7854 nginx "/docker-entrypoint.…" About an hour ago Up About an hour 80/tcp, 0.0.0.0:8090->8091/tcp, :::8090->8091/tcp test-nginx
But I'm not able to access the container via browser or curl command. I get the following error.
$ curl localhost
curl: (7) Failed connect to localhost:80; Connection refused
$ curl localhost:8090
curl: (56) Recv failure: Connection reset by peer
curl localhost:8091
curl: (7) Failed connect to localhost:8091; Connection refused
$ curl 10.57.8.115
curl: (7) Failed connect to 10.57.8.115:80; Connection refused
$ curl 10.57.8.115:8090
curl: (7) Failed connect to 10.57.8.115:8090; Connection refused
$ curl 10.57.8.115:8091
curl: (7) Failed connect to 10.57.8.115:8091; Connection refused
Could anyone please help me what is the issue and when I do
$ curl localhost:8090
It gives the following error?
curl: (56) Recv failure: Connection reset by peer