0

I am new to the concept of dockers and containers. So sorry if I frame the question in a wrong way. The issue is -

An aws EC2 instance which is running docker is failing load balancer health checks. I tired to curl docker container hosted web service from the instance and it returned curl: (56) Recv failure: Connection reset by peer I went through this question

As suggested in the answer I used netstat -an|grep LISTEN from within the container and it didn't return anything (No error. The control just went to next line returning nothing).

I have no clue what to do right now. Please help.

  • 1
    Can you post the contents of your Dockerfile/docker-compose.yml and the command you run to spin up the containers? – ryekayo Dec 05 '18 at 15:09

1 Answers1

0

My guess is that nothing really listens on that port. Is your container actually running the service you want it to run? Does ps ax from inside the running container show the process you expect? (e.g. httpd or nginx or whatwever you expect to listen on that port?)

Make sure your Dockerfile has the appropriate EXPOSE {port}, RUN {command} and/or CMD ... statements. That will ensure that 1) the command you want is actually started and 2) the port it listens on is exposed to the outside world.

MLu
  • 23,798
  • 5
  • 54
  • 81