Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Add option to remove container when action is done

未关闭
#285 5 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

@chrmarti 已经在做这个了。

开始于 2024年3月26日。

评估

这个 Issue 还没有评估数据。

描述

feature

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/[email protected]
        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

主要语言
TypeScript
星标
499
派生
101
PR 合并指标
30 天内没有已合并 PR

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

devcontainers/ci 的其他 Issue

查看 devcontainers/ci 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。