From an AWS ec2 instance (which runs docker
), I am trying to curl
my docker container-hosted web service.
Given:
[ec2-user]$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
b56fa0d76d5c $REGISTRY/$WORK/metrics:v0.1.0 "/bin/sh -c 'sh /root" 3 minutes ago Up 3 minutes 0.0.0.0:80->80/tcp, 0.0.0.0:9000->9000/tcp insane_leakey
I can hit the web service from within the container:
[ec2-user]$ docker exec -it b56fa0d76d5c bash
root@b56fa0d76d5c:/# curl 'http://localhost/health'
Request is missing required query parameter 'apiName'
But, I can't hit it from the host:
[ec2-user]$ curl 'http://localhost/health'
curl: (56) Recv failure: Connection reset by peer
I looked at this detailed answer on this curl
error, but I'm not sure how to debug this issue.