get permission denied when using docker in self-hosted server
See original GitHub issueHI all, I have an issue about using docker in self-hosted server I have a runner installed on ubuntu 18.04 The runner is running with svc.sh And my pipeline is using a docker The docker is already installed in the server and can run without sudo
# my pipeline
name: Go
on:
push:
branches: [ master ]
jobs:
build:
name: Build
runs-on: self-hosted
steps:
- name: check out
uses: actions/checkout@v2
- name: Use go docker
uses: docker://golang:1.13.9-alpine3.10
- name: Run go
run: go run main.go
logs
Pull golang:1.13.9-alpine3.109s
##[error]Docker pull failed with exit code 1
Pull down action image 'golang:1.13.9-alpine3.10'
/usr/bin/docker pull golang:1.13.9-alpine3.10
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.40/images/create?fromImage=golang&tag=1.13.9-alpine3.10: dial unix /var/run/docker.sock: connect: permission denied
##[warning]Docker pull failed with exit code 1, back off 3.258 seconds before retry.
/usr/bin/docker pull golang:1.13.9-alpine3.10
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.40/images/create?fromImage=golang&tag=1.13.9-alpine3.10: dial unix /var/run/docker.sock: connect: permission denied
##[warning]Docker pull failed with exit code 1, back off 5.8 seconds before retry.
/usr/bin/docker pull golang:1.13.9-alpine3.10
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.40/images/create?fromImage=golang&tag=1.13.9-alpine3.10: dial unix /var/run/docker.sock: connect: permission denied
##[error]Docker pull failed with exit code 1
any idea?
Issue Analytics
- State:
- Created 3 years ago
- Comments:14 (1 by maintainers)
Top Results From Across the Web
Docker-Compose Permission Denied using Root
Hi, I had no issues running docker, ran a script for something work related (I believe it might've installed another docker instance?)
Read more >Azure DevOps with self-hosted Ubuntu machine: docker fails
The problem is that the agent service has not the permissions to connect. You can either run the agent service as root (...
Read more >Why are Docker filesystem permissions behaving ...
1 Answer 1 ... The GitHub Actions probably has designated permissions for the uids/gids that are contained in the tar.gz and also of...
Read more >Permission Denied While Trying to Connect to the Docker ...
I started to investigate… I logged in to the Linux VM where this particular Self-Hosted Runner is hosted with the same credentials as...
Read more >How to Fix Docker Permission Denied?
The "Permission Denied" error appears when a system cannot communicate with the Docker daemon because the user lacks privileges.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@beetlikeyg087 I found your issue while trying to fix the same problem I managed to make the action run the docker command itself by also restarting the service with:
hope that helps
make sure you have given permission to the user that will run the github agent like so: