Self Hosted Runner running in a container fails to run steps inside a service container "sh: 0: Can't open /__w/_temp/xxx.sh"
See original GitHub issueDescribe the bug Hey,
My self-hosted runner is basically a container in itself that has access to the docker daemon socket. This allow it to perform docker
cli commands, useful for all kinds of operations. For simple stuff it’s quite neat and works as expected.
Now, I am trying to create a workflow that starts up a container and then tries to run its steps inside that container.
But it seems that it can’t even load some simple bash “run” steps such as echo "test"
and returns this instead:
Run echo "test"
echo "test"
shell: sh -e {0}
sh: 0: Can't open /__w/_temp/8e725f1d-7b7b-42e6-b0ad-103fa9200580.sh
Error: Process completed with exit code 127.
If I define the shell
parameter with value bash in the run step, I get something slightly different:
bash: /__w/_temp/baf2900f-87a1-4447-8b71-965fe79bef7d.sh: No such file or directory
Error: Process completed with exit code 1.
To Reproduce Here’s my yaml section in question:
.....
build-environment:
needs: get-ecr-credentials
runs-on: [self-hosted, gh-medium-x86]
container:
image: <my-custom-image-in-ecr>
credentials:
username: AWS
password: ${{needs.get-ecr-credentials.outputs.password}}
options: >-
--log-driver journald
--log-opt tag=mytag
steps:
- name: Test Run
run: echo "yeah"
Expected behavior Runner runs the echo step inside my custom image without erroring out
Runner Version and Platform
myoung34/github-runner:2.276.1-ubuntu-bionic
Amazon Linux 2 x86_64
EDIT 16/2:
Tried with setting privileged=true for the runner container, got the same errors
Tried also to use another non-custom container straight from the docker hub (i.e ubuntu:20.04), got the same errors
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:6
Top GitHub Comments
@djcarpe This is caused due to the lack of support for running the runner application inside docker: https://github.com/actions/runner/issues/406
Not sure if it helps but mounting the workdir from the host using
dockerVolumeMounts
in the ARC RunnerDeployment helps