[英]How to stop Docker (and Kubernetes) using Docker desktop?
I'm running Docker Desktop for MacOS and I don't know how to stop the Docker service.我正在为 MacOS 运行 Docker 桌面,但我不知道如何停止 Docker 服务。 It runs all the time using up the MacBook battery.
它一直运行,耗尽 MacBook 电池。
On a simple search, there are docs showing how to stop the containers but not the docker service itself.在简单的搜索中,有一些文档显示了如何停止容器而不是 docker 服务本身。
I might be missing something obvious, but is there a way to stop both Kubernetes and Docker service without having to kill the desktop app?我可能遗漏了一些明显的东西,但是有没有办法同时停止 Kubernetes 和 Docker 服务而不必终止桌面应用程序?
You can just quit the docker desktop last option in your image
.您可以退出
last option in your image
的 docker 桌面last option in your image
。 It will exit the docker and kubernetes also.它也将退出 docker 和 kubernetes。
Thanks谢谢
Ashish阿西什
I had been searching around for an answer to this too, as I noticed com.docker.hyperkit
was taking >3GB memory and a lot of CPU, when the desktop app wasn't even opened on Mac OS X Catalina, Docker Desktop 3.0.4我也一直在四处寻找答案,因为我注意到
com.docker.hyperkit
占用了 >3GB 内存和大量 CPU,当桌面应用程序甚至没有在 Mac OS X Catalina、Docker Desktop 3.0 上打开时。 4
Just as I was about kill -9
, I noticed that quitting the docker app again actually did kill off every process except com.docker.vmnetd
for whatever reason.就像我说
kill -9
,我注意到再次退出com.docker.vmnetd
应用程序实际上确实杀死了除com.docker.vmnetd
之外的所有进程,无论出于何种原因。
So I guess the solution here was... reopen and re-quit?所以我想这里的解决方案是...重新打开并重新退出? I also made sure, of course, there were no running containers.
当然,我还确保没有正在运行的容器。 I removed an old image too, unsure if that was related to it finally being able to fully quit.
我也删除了一个旧图像,不确定这是否与它最终能够完全退出有关。
The docker desktop app starts a qemu vm, so the desktop app has no control over the PIDs. docker 桌面应用程序启动一个 qemu vm,因此桌面应用程序无法控制 PID。 To oversome the "situation" do the following:
要过度处理“情况”,请执行以下操作:
open the Terminal app打开终端应用程序
edit the file ~/.bash_profile
编辑文件
~/.bash_profile
add the following lines添加以下几行
#macro to kill the docker desktop app and the VM (excluding vmnetd -> it's a service) function kdo() { ps ax|grep -i docker|egrep -iv 'grep|com.docker.vmnetd'|awk '{print $1}'|xargs kill }
Quit the terminal app and open it again.退出终端应用程序并再次打开它。
Type kdo
to kill all the dependend apps (hypervisor, docker daemon etc.)键入
kdo
以杀死所有依赖的应用程序(管理程序、docker 守护进程等)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.