Skip to content

ERROR: permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock #19

Description

@leogomide

I got the following error when i run docker build in a workflow using the self hosted runner

ERROR: permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Head "http://%2Fvar%2Frun%2Fdocker.sock/_ping": dial unix /var/run/docker.sock: connect: permission denied

the container has a mounted volume to /var/run/docker.sock and still got this error

to fix this, i have added the following step in the pipeline before calling docker build

  - name: Give docker permissions
    run: sudo chmod 666 /var/run/docker.sock

maybe some adjusts in the dockerfile for the gha-runner image fix this behaveiour

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions