How to stop Docker (and Kubernetes) using Docker desktop? How to stop Docker (and Kubernetes) using Docker desktop? kubernetes kubernetes

How to stop Docker (and Kubernetes) using Docker desktop?


The docker desktop app starts a qemu vm, so the desktop app has no control over the PIDs.To oversome the "situation" do the following:

  • open the Terminal app

  • edit the file ~/.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    }
  • save the file

Quit the terminal app and open it again.

Type kdo to kill all the dependend apps (hypervisor, docker daemon etc.)


You can just quit the docker desktop last option in your image. It will exit the docker and kubernetes also.

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

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.

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.