search

Home  >  Q&A  >  body text

macbook - docker service will hang after mac goes to sleep

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?

伊谢尔伦伊谢尔伦2756 days ago1876

reply all(3)I'll reply

  • 过去多啦不再A梦

    过去多啦不再A梦2017-07-03 11:43:03

    It is very convenient to manage containers with docker-composer

    reply
    0
  • 高洛峰

    高洛峰2017-07-03 11:43:03

    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

    reply
    0
  • 巴扎黑

    巴扎黑2017-07-03 11:43:03

    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.

    reply
    0
  • Cancelreply