devcontainers / devcontainers/ci

Add option to remove container when action is done

Aperta
#285 5 commenti 0 reazioni 1 assegnatario Rivendicata da @chrmarti Vedi su GitHub
feature
Lingua principale
TypeScript
Stelle
496
Fork
101
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Hi, I'm getting the following error when Github actions is trying to start a container and run commands. I have a simple workflow file, running on a self hosted runner.

```
name: run-tests
run-name: ${{ github.actor }} is running
on:
push:
# Sequence of patterns matched against refs/heads
branches:
- develop
workflow_dispatch:

env:
ARCH: amd64

jobs:
run-tests:
runs-on: self-hosted
steps:

- uses: actions/checkout@v4

- name: Build and run dev container task
uses: devcontainers/ci@v0.3.1900000348
with:
# ci.sh script builds and runs all unit tests
runCmd: chmod +x ./ci.sh && ./ci.sh
env:
ARCH: amd64
```

Github actions can build the dev container, but fails at the "_run command in container_" step of the "_Build and run dev container_" task.

```
🚀 Run command in container
About to run devcontainer exec --workspace-folder /home/me/actions-runner/_work/my_repo --remote-env GITHUB_OUTPUT=/mnt/github/output --remote-env GITHUB_ENV=/mnt/github/env --remote-env GITHUB_PATH=/mnt/github/path --remote-env GITHUB_STEP_SUMMARY=/mnt/github/step-summary bash -c chmod +x ./ci.sh && ./ci.sh

OCI runtime exec failed: exec failed: unable to start container process: current working directory is outside of container mount namespace root -- possible container breakout detected: unknown

Error: Dev container exec failed: (exit code: 126)
Error: Dev container exec failed: (exit code: 126)
```

I'm not sure exactly where this is originating from. If I `cd` to ` /home/me/actions-runner/_work/my_repo` and do `devcontainer exec --workspace-folder .` I get the same error msg:

`OCI runtime exec failed: exec failed: unable to start container process: current working directory is outside of container mount namespace root -- possible container breakout detected: unknown`

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.