Docker nginx become inaccessible after several hours

Expected behaviour

Official nginx container should be stable

Actual behaviour

Port forwarded NATted access fails after several hours.

Information

I have a ‘stable’ OSX boot2docker machine running in bridged mode on Virtual Box. Latest versions of OS X, Docker toolbox and VirtualBox.
The docker-machine is just about default - just the second network adapter is in bridged mode so that I can access its containers from a second mac.

Mac is on 192.168.123.8, the docker-machine it hosts is on 192.168.123.25 (second interface) I can access the nginx web sites such as 192.168.123.25:8080 - this container can be accessed by any other computer on my subnet. So far so good.

Recently I wanted to made these containers accessible from the internet and set up the connection using port forwarding:

Cable modem -> airport extreme -> mac running docker machine.

85.xx.xx.xx:8080 -> airport extreme does port forwarding from 8080 to 192.168.123.25:8080

ngnix sites are visible from the internet - I was really happy.

The following morning it is not working - the access from the internet has stopped responding - times out. However the nginx site is still running and accessible via the internal ip address 192.168.123.25:8080. I assumed that the problem was the airport or internet connection - restarted both - no change.
I then tried to restart the container - still not working externally.
Finally after restarting the docker-machine and the container the site is working and once again accessible from the internet.

This has happened each time i restart the docker-machine - Always the nginx container is responding on the local address / port, but access through the airport express to the same address fails after some hours.

I’m struggling to know where I can begin to diagnose the problem - any theories / suggestions as to what is causing this type of behaviour?

Steve

Moving to the proper forums

Hi Steve,

I think that’s not a problem with Docker. But a guess in the dark: Do oyu have setup “Energy Saver”?

Cheers
Michael

Thanks’ for the suggestion

No, no energy saver - access from the lan continues without interruption, it is just the connection port forwarded from the internet. But I can only recover access by restarting the docker machine.

cheers
Steve

Can you please provide link(s) to the forum where i can get proper solution.

Did you find the solution for this ???
I am currently setting up my nginx with docker (Swarm service) and facing the same issue in Windows-For-Docker on Windoes 10 machine.

After running for a few hours (Mostly btn 2-3 hrs) of nginx container on the host machine I am unable to access any container which is created with Port mapping to host from any external machine using HOSTIP:Port.
The containers are still running and so are services.

Can you redirect me to any link which can help me in diagnosis of this issue or solution to it.

Thanks.