devcontainers / devcontainers/ci

Add option to remove container when action is done

Open
#285 5 comments 0 reactions 1 assignee Claimed by @chrmarti View on GitHub
feature
Dominant language
TypeScript
Stars
496
Forks
101
PR merge metrics
No merged PRs in 30d

Description

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`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.