I was trying to run
docker run hello-world to test if my docker installation works. I used then the command brew services start docker-machine to start docker machine via Homebrew. However, I get this error:
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
And every time I want to connect to the docker machine I have to do the steps stated in this post: Docker can't connect to docker daemon to be able to use my docker-machine:
docker-machine start # Start virtual machine for docker
docker-machine env # It's helps to get environment variables
eval "$(docker-machine env default)" # Set environment variables
I don't understand why I have to do these steps every time I want to run docker on my virtual machine.