vegardit / docker-gitea-act-runner

Docker image based on debian:stable-slim to run Gitea's act_runner as a Docker container
https://buymeacoffee.com/vegardit
Apache License 2.0
168 stars 18 forks source link

Specify valid volumes for folders in the container #58

Closed my1e5 closed 1 month ago

my1e5 commented 5 months ago

I'm using a DIND approach. My understanding was that GITEA_RUNNER_VALID_VOLUME_N would allow me to specify volumes in the parent docker container that the runner docker containers could use.

For example, if I try to mount a volume within my action yaml I get [foo] is not a valid volume, will be ignored. (Related https://github.com/vegardit/docker-gitea-act-runner/issues/54)

jobs:
  ci:
    runs-on: ubuntu-latest
    container:
      volumes:
        - /foo:/foo"

So I figured I need to use GITEA_RUNNER_VALID_VOLUME_N. But when I try that it seems to use a path from my Windows host machine?

 docker run \
    -e GITEA_INSTANCE_URL=https://gitea.example.com \
    -e GITEA_RUNNER_REGISTRATION_TOKEN=<INSERT_TOKEN_HERE> \
    -e GITEA_RUNNER_VALID_VOLUME_1=/foo \
    --name gitea_act_runner \
    --privileged
    vegardit/gitea-act-runner:dind-latest
 2024-06-04 12:30:30  - GITEA_RUNNER_CONFIG_TEMPLATE_FILE=/opt/config.template.yaml
2024-06-04 12:30:30  - GITEA_RUNNER_GID=1000
2024-06-04 12:30:30  - GITEA_RUNNER_LABELS=
2024-06-04 12:30:30  - GITEA_RUNNER_LABELS_DEFAULT=ubuntu-latest:docker://catthehacker/ubuntu:act-22.04,ubuntu-22.04:docker://catthehacker/ubuntu:act-22.04,ubuntu-20.04:docker://catthehacker/ubuntu:act-20.04
2024-06-04 12:30:30  - GITEA_RUNNER_NAME=
2024-06-04 12:30:30  - GITEA_RUNNER_REGISTRATION_RETRY_INTERVAL=5s
2024-06-04 12:30:30  - GITEA_RUNNER_REGISTRATION_TIMEOUT=30
2024-06-04 12:30:30  - GITEA_RUNNER_REGISTRATION_TOKEN=******
2024-06-04 12:30:30  - GITEA_RUNNER_UID=1000
2024-06-04 12:30:30  - GITEA_RUNNER_VALID_VOLUME_1=C:/Program Files/Git/foo

Notice the C:/Program Files/Git/foo.

So I still get [foo] is not a valid volume, will be ignored when I try run my action.

Am I doing something wrong?

github-actions[bot] commented 2 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. If the issue is still valid, please add a respective comment to prevent this issue from being closed automatically. Thank you for your contributions.