How do I start the docker daemon from terminal [ on MacOS ] ?
TL;DR
I use a combination of open
, and docker info
to start the docker daemon from terminal on MacOS.
open -a docker && while ! docker info > /dev/null 2>&1; do sleep 1 ; done
For the curious
First, we open the Docker application by passing docker
to the -a
or application flag of the open
command.
open -a docker
For me, the engine takes a few seconds to actually boot, so I run docker info
until it returns an exit code of 0 ( or success ).
while ! docker info; do sleep 1 ; done
Since I don't like seeing the terminal output while waiting, I redirect it to /dev/null
. I want to capture errors and output alike, so I pass 2>&1
which says to send standard error and standard output to the same place.
> /dev/null 2>&1
Finally, we get the command.
open -a docker && while ! docker info > /dev/null 2>&1; do sleep 1 ; done
docker info
? And what versions of docker, docker-compose, and docker-machine do you have installed? You need to make sure they're compatible with the Docker app.