Search code examples
dockerdocker-machine

curl: (56) Recv failure: Connection reset by peer - Docker


I am getting below error:

$ docker container run -d --name web -p 9090:9090 -v `pwd`/webapp.war:/opt/jboss/wildfly/standalone/deployments/webapp.war jboss/wildfly
4be6d47c7e6d923fef1d04e12edd6365bdd4fe0087844018b3e5a6b0f6e0c12c

$ docker container ps -a
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                              NAMES
4be6d47c7e6d        jboss/wildfly       "/opt/jboss/wildfl..."   15 seconds ago      Up 14 seconds       8080/tcp, 0.0.0.0:9090->9090/tcp   web

$ curl http://localhost:9090/webapp/resources/persons
curl: (56) Recv failure: Connection reset by peer
$

Solution

  • Make sure you run your service as 0.0.0.0:{port} rather than 127.0.0.1:{port}.