Reputation: 650
I've an express application that takes data from an IronMQ push queue. I've Dockerized this app and on running the application in a Docker Container, after some idle time say 20-30 mins, the App throws an error and exits out:
Error: read tcp 192.168.59.3:50346->192.168.59.103:2376: read: operation timed out
My boot2docker ip --> 192.168.59.103
I've forwarded the port at 3000.
I've tried using process object to catch uncaught exception but to no help.
Note: I've ran the app outside of docker on my local, and the app runs fine without throwing an error and logging out. So the problem seems to with docker.
Upvotes: 0
Views: 1879
Reputation: 650
As it turns out, when you execute the docker run command in the attached mode i.e with the -a parameter or wiihout the -d parameter, something like:
docker run -a <imageID>
or docker run <imageID>
Docker detaches from the container by default after sometime and runs the container in detached mode. Meaning your application runs fine in the background.
Hence the error: timed out
Note: This is not explicitly mentioned in the docker docs, so thought this could be documented here for future reference.
Upvotes: 4