Search code examples
macosdockerosx-elcapitandocker-machine

How to start docker-machine on OSX?


I've installed and use docker for the first time yesterday,

Everything was working properly, but yesterday night I've shutdown my computer.

Today I start it and I wanted to work on my docker app, But when I try to run it like

docker run -d -p 8080:8080 container/app

I got the error :

docker: Cannot connect to the Docker daemon. Is the docker daemon running on this host?.

But I can't find how to launch docker again...

Ideas ?

EDIT :

eval "$(docker-machine env default)"

result:

Error checking TLS connection: Host is not running


Solution

  • The docker-machine env default command won't work if the "default" machine is not running.

    You can run the docker-machine ls command, which should give you a list of machines that are configured, and their current status (running, stopped).

    If a machine is stopped, run docker-machine start <name-of-machine>. After that you should be able to set the environment variables using

    eval "$(docker-machine env default)"
    

    please read the documentation at https://docs.docker.com/machine/overview for more details