curl (56) Recv failure: Connection reset by peer - when hitting docker container

13,572

Do a small check by running:

docker run --network host -d <image>

if curl works well with this setting, please make sure that:

  1. You're mapping the host port to the container's port correctly:
docker run -p host_port:container_port <image>
  1. Your service application (running in the container) is running on localhost or 0.0.0.0 and not something like 127.0.0.1
Share:
13,572
sysadmin umesh
Author by

sysadmin umesh

Updated on June 04, 2022

Comments

  • sysadmin umesh
    sysadmin umesh almost 2 years

    getting this error while curl the application ip

    curl (56) Recv failure: Connection reset by peer - when hitting docker container