Closed Miladiir closed 10 months ago
are you using dind? does it work with dood?
can you run the hello world docker image in your workflow?
I have the worst luck. I tried to use the latest tag to try out dood, now I got this:
gitea_runner-gitea_act_runner-1 | 2023-07-24 21:13:38 INFO [/opt/run.sh:127] Fixing permissions...
gitea_runner-gitea_act_runner-1 | sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
gitea_runner-gitea_act_runner-1 | sudo: a password is required
Which makes little sense to me since I did not modify the user in any way and also did not specify any uids or gids in the docker compose yml. Seems like it is setup correctly in the dockerfile etc. Very weird.
But yes, I am using dind and the hello world container works:
-
uses: https://github.com/actions/hello-world-docker-action@main
with:
who-to-greet: 'Mona the Octocat'
It seems that the docker.sock is not mounted into child containers, which is either a good thing from a security perspective or a bad thing from a "I cannot build docker containers" perspective.
I currently have limited internet access atm. I can try to reproduce the issue earliest on Wednesday.
No worries, it is absolutely not urgent or anything. I value your time and your help.
I am not getting the sudo: a password is required
even if sudo is executed. Can you paste the compose file or command with args how you are trying to run the container?
version: '3.8'
services:
gitea_act_runner:
image: vegardit/gitea-act-runner:latest
volumes:
- data:/data
- /var/run/docker.sock:/var/run/docker.sock
environment:
TZ: "Europe/Berlin"
GITEA_INSTANCE_URL: 'url'
GITEA_RUNNER_REGISTRATION_TOKEN: 'token'
GITEA_RUNNER_NAME: 'runnername'
GITEA_RUNNER_MAX_PARALLEL_JOBS: 4
volumes:
data:
ONTAINER REPOSITORY TAG IMAGE ID SIZE
gitea_runner-gitea_act_runner-1 vegardit/gitea-act-runner latest d93dd316fe01 44.8MB
I am also using dind with this:
jobs:
build:
runs-on: ubuntu-latest
container:
volumes:
- /etc/ssl/certs/mkcert.pem:/etc/ssl/certs/mkcert.pem
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build and push Docker Image
uses: docker/build-push-action@v4.1.1
In docker buildx
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/version": dial unix /var/run/docker.sock: connect: permission denied
::error::The process '/usr/bin/docker' failed with exit code 1
compose:
gitea_act_runner:
image: vegardit/gitea-act-runner:dind-latest
privileged: true
volumes:
- /mnt/exthdd/gitea_act_runner/data:/data:rw # the config file is located at /data/.runner and needs to survive container restarts
- /mnt/exthdd/ca/mkcert.pem:/etc/ssl/certs/mkcert.pem
environment:
- GITEA_RUNNER_REGISTRATION_TOKEN=${GITEA_RUNNER_TOKEN}
- GITEA_RUNNER_JOB_CONTAINER_PRIVILEGED=true
- GITEA_RUNNER_VALID_VOLUME_1=/etc/ssl/certs/mkcert.pem
Tried some playing around, specifying UID and GID using their env variables GITEA_RUNNER_UID but same result.
Using the dood option is a bit tricky for my case, since the real use case is within a local dns with a root-ca, dind has some convenience there.
Thanks for any hints in advance!
If you encounter this, add sudo chmod 666 /var/run/docker.sock
in your steps, that resolves the issue. Just be aware this opens up the access, I am using this locally so I don't care.
I have the same problem in dood.
docker-compose:
gitea_act_runner:
image: vegardit/gitea-act-runner:latest
platform: linux/arm64
container_name: act_runner
volumes:
- /var/run/docker.sock:/var/run/docker.sock:rw
- act-data:/data:rw # the config file is located at /data/.runner and needs to survive container restarts
environment:
TZ: "Asia/Yekaterinburg"
USER_UID: 1000
USER_GID: 1000
# config parameters for initial runner registration:
GITEA_INSTANCE_URL: '***'
GITEA_RUNNER_REGISTRATION_TOKEN: '***'
Gitea Actions file:
name: Build Docker image
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
on: [push]
jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Build and push
uses: docker/build-push-action@v4
with:
push: false
tags: yt-chat/downloader
Error in act-runner logs:
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/version": dial unix /var/run/docker.sock: connect: permission denied
::error::The process '/usr/bin/docker' failed with exit code 1
Eventually, @sysbite solution helped me temporarily.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.
Maybe this is an upstream issue. My workflow:
Error in docker/setup-qemu-action@v2 :
I also tried with other paths. Does somebody know how to get this working?