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?
Stopping a Container Using Process SignalsWith the docker run commands --stop-signal flag, you can specify the stop signal when starting the container. This flag sets the signal that will be sent to the running container when you want it to stop.
To stop a container you use the docker stop command and pass the name of the container and the number of seconds before a container is killed. The default number of seconds the command will wait before the killing is 10 seconds.
As of today's latest version you can stop DOCKER Desktop App by clicking the "ship" symbol in the top panel and then hit "Quit 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 }
Quit the terminal app and open it again.
Type kdo
to kill all the dependend apps (hypervisor, docker daemon etc.)
You can open the Activy Monitor, select Docker and then use the Quit button.
Maybe you will need to use the Force Quit option.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With