如何为 mac 在 Docker 中自动启动 docker 个容器?

How to auto start docker containers in Docker for mac?

Docker Mac 的桌面在我的笔记本电脑每次唤醒时重新启动,我必须通过 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 守护程序重新启动时,之前使用该选项启动的所有容器都应该再次 运行。