Docker Community Forums

Share and learn in the Docker community.

Start Docker, Kubernetes from the command line?

Hi all – I’m trying to control Docker Desktop for Mac (as distinct from the docker daemon itself) from the command line. Maybe I’m just misreading, but I don’t see anything in the docs about how to do this. I’m wondering if it’s possible?

For example, I don’t like to leave Kubernetes running all the time on my laptop because it consumes some system resources and decreases battery life a bit, but I do have some test scripts that need Kubernetes. It’d be really handy if I could add some logic to my scripts that starts Kubernetes if necessary at the top of the script and stops it at the end.

It would also be nice to start/stop Docker itself (I guess I can stop it by clever use of ‘kill’ but that seems icky…), reset Docker or Kubernetes when I inevitably mess something up, etc.

I know I can do all of the above through the UI, but, well, I like my CLI :slight_smile: It works ok for now, but I do like being able to automate stuff to save myself some time.