GithubHelp home page GithubHelp logo

Comments (3)

julian1059 avatar julian1059 commented on June 27, 2024 1

@ukewea great discovery!! I too was having the same issue checking out code when using containers for my jobs. However, my setup is within Kubernetes. My pod has two containers, the runner and the docker in docker container used to run all docker commands/actions. The underlying file structure is shared through a set of volumes. Sure enough, my docker in docker container did not have the directory /actions-runner/ as you discovered above. I was able to use an initContainer to copy the data from the /actions-runner/ dir on the image to my shared volume. Once both the containers spun up, they each had access to the entirety of the /actions-runner/ directory. Confirmed code checkout then worked without a hitch 👍

initContainers:
  - name: configure-actions-runner-dir
    image: myoung34/github-runner:latest
    command: ["/bin/bash", "-c"]
    args:
      - |
        cp -R /actions-runner/* /actions-runner-volume/
    securityContext:
      runAsUser: 0
    volumeMounts:
      - mountPath: /actions-runner-volume/
        name: actions-runner

from docker-github-actions-runner.

myoung34 avatar myoung34 commented on June 27, 2024

This is a question for the upstream actions team, this repo is only concerned with installing the runner itself

from docker-github-actions-runner.

ukewea avatar ukewea commented on June 27, 2024

Thanks for the hint, after some digging, it is the issue of job container creation.

In the "Initialize containers > Starting job container" step, by looking at the command that used to start a new container, we can notice that it mapped /actions-runner/externals on my host machine to /__e in the containers that runs the job, but /actions-runner/externals only exists in the container that the runner was in, not on the host machine.

image

Raw text:

/usr/bin/docker create --name 7954e543b87540929d1873e3be523ef2_******dotnet_sdk_nodejs6020x_c0b4e8 --label c3f261 --workdir /__w/dotnet-cicd-eval/dotnet-cicd-eval --network github_network_69a556d20d5b4b48a1955f3b83e167b5  -e "HOME=/github/home" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/tmp/runner/work_2":"/__w" -v "/actions-runner/externals":"/__e":ro -v "/tmp/runner/work_2/_temp":"/__w/_temp" -v "/tmp/runner/work_2/_actions":"/__w/_actions" -v "/opt/hostedtoolcache":"/__t" -v "/tmp/runner/work_2/_temp/_github_home":"/github/home" -v "/tmp/runner/work_2/_temp/_github_workflow":"/github/workflow" --entrypoint "tail" ******/dotnet_sdk_nodejs:6.0-20.x "-f" "/dev/null"

I have a possible workaround: looks like it is possible to override the path of volumes to be mapped into job containers by creating a json file. Maybe I can give it a try and report in the next few days.

from docker-github-actions-runner.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.