如何从终端重新启动Mac的Docker? [英] How do I restart Docker for Mac from the terminal?
问题描述
适用于Mac的Docker在菜单栏中的鲸鱼图标下拉菜单中有一个漂亮的小重新启动"按钮.
Docker for Mac has a neat little 'restart' button in the dropdown from the whale icon in the menu bar.
不过,我希望能够从终端重启Docker for Mac.我需要运行什么命令?
I'd like to be able to restart Docker for Mac from the terminal, though. What command would I need to run?
推荐答案
专门用于Mac的Docker,因为它是一个"GUI"应用程序,所以有一个
Specifically for Docker for Mac, because it's a "GUI" app, there's a workaround:
osascript -e 'quit app "Docker"'
由于您要重新启动,因此这是从命令行打开它的方法:
Since you'd want to restart, here's the way to open it from the command line:
open -a Docker
使用osascript
打开的命令可能更对称,但是open
命令似乎比osascript
命令更常见.
There's probably a more symmetrical command to open using osascript
, but the open
command seems more common than the osascript
one.
这篇关于如何从终端重新启动Mac的Docker?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!