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

11/12/2020

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.

<img src="https://i.stack.imgur.com/buRf4.png" width="200" />

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?

-- &#201;be Isaac
docker
docker-desktop
kubernetes

3 Answers

7/27/2021

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

<pre> #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 } </pre>
  • save the file

Quit the terminal app and open it again.

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

-- Hannes Stoolmann
Source: StackOverflow

5/31/2021

You can open the Activy Monitor, select Docker and then use the Quit button.

Maybe you will need to use the Force Quit option.

**enter image description here**

-- valdeci
Source: StackOverflow

5/25/2021

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.

-- h4xnoodle
Source: StackOverflow