The commands are:
docker open - Open Docker Desktop (and therefore start the docker daemon) from your terminal.
docker close - Close Docker Deskt...
For further actions, you may consider blocking this person and/or reporting abuse
I leave docker running all the time and leave my macbook with the lid closed. My workflow is otherwise pretty similar to yours.
I don't think there's any difference between running
docker container stopanddocker stop, and I can't think of a reason you'd need to attempt to stop containers which aren't running (what the-agives you), so mine looks like this:docker stop $(docker ps -q)I call my version "undock", because I like making it obvious what're official docker commands and what're my additions - I have a very small brain and don't want to get used to expecting subcommands which don't exist on other environments!
Why just Mac? Shouldn't it work with Linux or WSL? I believe it should.
You could make such a script for Linux, but it would need to be altered. The script I posted here is based on opening the Docker Desktop app via the command line. On Linux, you'd probably just want to start or stop the daemon (
systemctl start dockerandsystemctl stop docker). The flush command might work out of the box, especially if you're running Zsh on your Linux machine.This is neat to see. One reason why I got into Orbstack not too long ago was because it comes with a command-line app that lets you start and stop the app like what's shown here.