devcontainers / devcontainers/ci

Add option to remove container when action is done

Offen
#285 5 Kommentare 0 Reaktionen 1 zugewiesene Person Beansprucht von @chrmarti Auf GitHub ansehen
feature
Vorherrschende Sprache
TypeScript
Sterne
496
Forks
101
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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`

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.