Stuck with “Connection reset by peer docker” error? We can help you.
As part of our Docker Hosting services, we assist our customers with several Docker queries.
In this article, let us see how we can resolve this connection error.
“Connection reset by peer docker” error
Usually when a Container/Pod running in Docker/Kubernetes retrieves data from external services, connection reset problem could happen.
Depending on what tool you use (curl, browser, etc.), you may get a different error.
The result is same. Your web server will not return back the page you expect.
What causes “Connection reset by peer docker” error?
The error might occur because your web server is bound to localhost which means it is available inside of your container.
Check if the server application is configure to only listen to requests coming from its “localhost”.
This check depends on type of server that you are using.
Check by starting your container by running the following:
docker run --network host -d yourimagename
Then try to curl, if that works, then you will just need to review your server listening IP setting.
curl localhost:10009
Replace “10009” with the appropriate port number.
How to resolve it?
Today, let us go through the simple solution given by our Support Techs.
To fix this problem, bind your web server to 0.0.0.0 instead.
This will allow anyone to connect to your web server as long as they have access to your network.
This is almost always what you want for a public facing web application.
Make sure to publish -p 3000:3000 when running your container if you want it to access on that port.
[Stuck with the docker error? We’d be happy to assist you]
Conclusion
In short, today we have discussed about the solution provided for Connection error by our Support Techs.
0 Comments