How to stop Docker (and Kubernetes) using Docker desktop?
Nov 12
I'm running Docker Desktop for MacOS and I don't know how to stop the Docker service. It runs all the time using up the MacBook battery.
On a simple search, there are docs showing how to stop the containers but not the docker service itself.
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?
1 answer
Accepted answer · original discussion
Jul 27
The docker desktop app starts a qemu vm, so the desktop app has no control over the PIDs. To overcome the "situation" do the following:
open the Terminal app
edit the file
~/.bash_profileadd 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
}
- save the file
Quit the terminal app and open it again.
Type kdo to kill all the dependend apps (hypervisor, docker daemon etc.)
Your perspective belongs here.
1 question comment
Use comments to ask for clarification. Post a solution as an answer.
Nov 12