Cannot connect to docker daemon


#1

Hello,
I am creating a base image based off of ubuntu:14.04. I need to run docker from within this image on circle. I installed docker-engine on the image (in my Dockerfile). I also added the steps listed above to “Install docker engine”. However, I keep seeing the error “Cannot connect to docker daemon…”. Any ideas on how to run Docker-in-docker on circle?

Inside circle,

docker --version
Docker version 1.12.6, build 78d1802

However,

docker run hello-world
docker: Cannot connect to the Docker daemon. Is the docker daemon running on this host?.
See 'docker run --help'.
Exited with code 125

Thanks a lot
Suchit


Getting Started: Docker Engine
#2

Did you run the other steps? They are not necessary in the machine version.

      - type: checkout
      - type: shell
        name: Install Docker Client
        command: |
          echo "test"
          curl -L -o /tmp/docker.tgz https://get.docker.com/builds/Linux/x86_64/docker-1.12.3.tgz
          tar -xz -C /tmp -f /tmp/docker.tgz
          mv /tmp/docker/docker* /usr/bin/

          curl -L "https://github.com/docker/compose/releases/download/1.9.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/bin/docker-compose
          chmod +x  /usr/bin/docker-compose

      - type: setup-docker-engine
      - type: shell
        name: Verify Docker Works
        command: |
          docker --version
          docker run hello-world

#3

@rohara, thanks for your reply. That worked, thanks. I was actually not running the setup-docker-engine step :). One more question. Previously, there was an env variable called CIRCLE_ARTIFACTS. is there an equivalent in circle2?


#4

@suchitagarwal No. Ricardo has documented some info on the env vars: CircleCI Environment Variables - 1.0 vs 2.0

Instead, just use artifacts-store and specify where your artifacts can be found.


#5

@rohara, thanks. Sounds good, I will try that. Also, is there any way to tell circle to run setup-docker-engine only if it is on a certain branch?


#6

@suchitagarwal Not yet but I definitely understand the use case for that.


#7