适用于 Mac 的 Docker 桌面 每次我的笔记本电脑唤醒时都会重新启动,我必须通过 docker start <container> 手动启动所有容器.有没有办法自动完成?

请您参考如下方法:

您可以尝试使用 --restart always 运行您的容器政策。
docker run Restart policies .

Always restart the container regardless of the exit status.
When you specify always, the Docker daemon will try to restart the container indefinitely.
The container will also always start on daemon startup, regardless of the current state of the container.



这样,当 docker 守护进程重新启动时,之前使用该选项启动的所有容器都应该再次运行。


评论关闭
IT干货网

微信公众号号:IT虾米 (左侧二维码扫一扫)欢迎添加!