我在 mac 上安装了 docker 桌面。所以为了启动docker,我打开应用,找到docker。然后我可以在顶栏看到一个泊坞窗图标。稍后我可以从命令行运行 docker 命令。
我的问题是如何从命令行启动 docker 本身?
谷歌搜索获取我如何从命令行启动容器的结果:|
你会macOS使用launchctl:
目前尚不清楚您实际上打算运行哪个服务,尽管相当于service或systemctlonLinux已launchctl打开macOS(例如,运行 dockerregistrylaunchd):
将 Docker 注册表 plist 复制到位:
\n\nplutil -lint registry/recipes/osx/com.docker.registry.plist\ncp registry/recipes/osx/com.docker.registry.plist ~/Library/LaunchAgents/\nchmod 644 ~/Library/LaunchAgents/com.docker.registry.plist\nRun Code Online (Sandbox Code Playgroud)\n\n启动 Docker 注册表:
\n\nlaunchctl load ~/Library/LaunchAgents/com.docker.registry.plist\nRun Code Online (Sandbox Code Playgroud)\n\n重启dockerregistry服务
\n\nlaunchctl stop com.docker.registry\nlaunchctl start com.docker.registry\nRun Code Online (Sandbox Code Playgroud)\n\n卸载dockerregistry服务
\n\nlaunchctl unload ~/Library/LaunchAgents/com.docker.registry.plist\nRun Code Online (Sandbox Code Playgroud)\n\n\xe2\x86\xb3在 launchd 下运行 Docker 注册表
\n您可以使用以下方法在 MAC 上打开 && 重新启动 Docker:-
open -a Docker
sudo systemctl restart docker
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
11173 次 |
| 最近记录: |