0

My pipeline.yml file looks below, where i am trying to install docker and run docker pull inside the ubuntu container which concourse created. FYI...

---
resources:
- name: hello_hapi
  type: git
  source:
    uri: https://<username>:<password>@github.com/rohithmn3/hello_hapi.git
    branch: master

platform: linux

jobs:
- name: job-hello-world
  public: true
  plan:
  - get: hello_hapi
    trigger: true
  - task: hello-world
    config:
      platform: linux
      image_resource:
        type: docker-image
        source:
          repository: ubuntu
          volumes: /var/run/docker.sock:/var/run/docker.sock
          privileged: true
      inputs:
        - name: hello_hapi
      outputs:
        - name: update_times
      run:
        path: hello_hapi/task_show_uname.sh

I have kept the code in github public repo : https://github.com/rohithmn3/hello_hapi/blob/master/task_show_uname.sh

When i run the concourse pipeline, it FAILS - as it couldn't able to run docker images command post docker installation. Below is the Error/Exception:

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

I am getting above error/exception because, i couldn't able to bind socket while docker build. Help me here...!?

Regards, Rohith

Rohith
  • 1,077
  • 5
  • 16
  • 36

2 Answers2

0

i was getting similar error which i fixed with running docker as superuser sudo docker-compose up

captainchhala
  • 831
  • 1
  • 7
  • 14
0

I'm sure that by now you've moved on, but for the benefit of others: on Linux this usually means that the docker service is not started:

sudo systemctl start docker.service

To make sure that the service is always running in the background, use "enable":

sudo systemctl enable docker.service
kuzyn
  • 1,905
  • 18
  • 30