Overview
If you receive the following error message while running a CircleCI 2.0 build:
Cannot connect to the Docker daemon at unix:///var/run/docker.sock.
Is the docker daemon running?
You may also encounter the following error:
Exception message: /home/circleci/.docker/config.json (No such file or directory)
This typically indicates that you are running a docker command without using remote docker.
In order to run any docker command on CircleCI 2.0 you need to add the setup_remote_docker
step as described in the following documentation. You can also use the machine executor.
Comments
Looks like you have to have Docker loaded first. That kind of sucks =/.
I'm using OS X and running Docker for Mac: Version 18.03.1 . https://docs.docker.com/docker-for-mac/install/
First, I had installed CircleCI CLI via the following command as described in https://circleci.com/docs/2.0/local-cli/#installing-the-circleci-local-cli-on-macos-and-linux-distros
`$ curl -o /usr/local/bin/circleci https://circle-downloads.s3.amazonaws.com/releases/build_agent_wrapper/circleci && chmod +x /usr/local/bin/circleci`
Then, before loading Docker for Mac:
```
$ circleci config valididate -c .circleci/config.yml
Receiving latest version of circleci...
Warning: failed to get default registry endpoint from daemon (Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?). Using system default: https://index.docker.io/v1/
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
```
Then, after loading Docker for Mac:
```
$ circleci config valididate -c .circleci/config.yml
Receiving latest version of circleci...
Validate and update the circleCI configuration file
Usage:
circleci config [command]
...and so on...
```
Article is closed for comments.