[duplicate] Plugins/docker unable to access docker socket

Hello,

I recently scaled-up my kube cluster and removed my old small nodes (this was a bad idea without testing Drone first, but let’s not go there for a moment)

Previously I had been using the plugins/docker image to build images and it worked flawlessly. However after I upgraded, now I’m getting the following error on all builds using plugins/docker:

  • /usr/local/bin/dockerd --data-root /var/lib/docker --host=unix:///var/run/docker.sock

  • /usr/local/bin/docker version
    Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

It was my understanding that Drone runs the plugins/docker image as privileged by default, and thus I shouldn’t be having this issue. I’m sure there’s a simple answer but I can’t find it after many hours of googling and I’m starting to get stressed out. Can you help me figure out why this is happening? I haven’t changed my pipeline config at all.

For reference, here’s my yaml:


---
kind: pipeline
type: kubernetes
name: default

steps:
- name: Clone helm template
  image: alpine/git
  commands:
    - git submodule add -b rolling_deploy https://github.com/REDACTED
    - cp helm-template/Dockerfile .

- name: build
  image: plugins/docker
  settings:
    registry: registry.digitalocean.com
    repo: registry.digitalocean.com/REDACTED/${DRONE_REPO_NAME}
    tags:
      - ${DRONE_COMMIT_SHA:0:7}
      - ${DRONE_COMMIT_BRANCH}
      - latest
    force_tag: true
    use_cache: true
    username: 
      from_secret: username
    password:
      from_secret: password
  volumes:
    - name: docker
      path: /var/lib/docker   

- name: deploy
  image: alpine/helm
  commands:
    - helm list
    - apk add git
    - cd helm-template && find . -type f -exec sed -i "s/REPLACE/`echo ${DRONE_REPO_NAME}| tr '.' '-'`/g" {} \; && find . -type f -exec sed -i "s/DOMAIN/${DRONE_REPO_NAME}/g" {} \; && helm upgrade --install `echo ${DRONE_REPO_NAME}| tr '.' '-'` . -n wordpress -f ../override-values.yaml

image_pull_secrets:
   - dockerconfigjson
   
---
kind: secret
name: dockerconfigjson
get:
  path: secret/data/dockerconfigjson
  name: dockerconfigjson

---
kind: secret
name: username
get:
  path: secret/data/dockerrepo
  name: username

---
kind: secret
name: password
get:
  path: secret/data/dockerrepo
  name: password

Moving conversation to existing thread at [solved] K8S runner problem with volumes