macbook - docker service will hang after mac goes to sleep
伊谢尔伦2017-07-03 11:41:03
0
3
1844
If the mac wakes up after sleeping, the services started by docker will hang up, and then they have to be started one by one. It is very troublesome. Does anyone know how to set it up?
hhh, yesterday I also encountered a situation where docker was working abnormally after closing the lid of my mac. And the abnormality was very profound.
The container seemed to be running normally, and the service seemed to be normal. But the Unix timestamp in the container was wrong!__, which caused a chain bug. After troubleshooting for a whole afternoon, I finally discovered that the timestamp obtained in the container was wrong. I was frozen at the moment I closed the lid....
Oh, by the way, docker is designed with an automatic restart option. When creating a container, just set –restart to an appropriate value. It has several options. Always restart/restart after non-manual exit/not restart
Try to use the daemon to start the service. docker run -d. First, make sure that docker is not down. Here I use docker-compose up -d to start the service, and then turn it on after hibernation to run the service normally. It probably isn’t the reason for the mac’s energy-saving settings.
It is very convenient to manage containers with
docker-composer
hhh, yesterday I also encountered a situation where docker was working abnormally after closing the lid of my mac. And the abnormality was very profound.
The container seemed to be running normally, and the service seemed to be normal. But the Unix timestamp in the container was wrong!__, which caused a chain bug. After troubleshooting for a whole afternoon, I finally discovered that the timestamp obtained in the container was wrong. I was frozen at the moment I closed the lid....
Oh, by the way, docker is designed with an automatic restart option. When creating a container, just set –restart to an appropriate value. It has several options. Always restart/restart after non-manual exit/not restart
Try to use the daemon to start the service.
docker run -d
. First, make sure that docker is not down. Here I usedocker-compose up -d
to start the service, and then turn it on after hibernation to run the service normally. It probably isn’t the reason for the mac’s energy-saving settings.