如何从终端重新启动Mac的Docker? [英] How do I restart Docker for Mac from the terminal?

查看:623
本文介绍了如何从终端重新启动Mac的Docker?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

适用于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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆