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

Cannot build devcontainers features

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

@olivierlemasle 已经在做这个了。

开始于 2025年7月29日。

  • #3 来自 @francoism90 —— 已合并
  • #606 来自 @olivierlemasle —— 未关闭

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
shell, vscode
领域
devops

调研方向

首先使用 Podman 和所示的 podman-remote buildx 命令复现报告中的 VS Code Flatpak 设置。调查为什么 /tmp/devcontainercli-user/container-features/... 对主机端的 Podman 构建不可用,而 Dockerfile 和构建上下文却是从 Flatpak 环境传递过来的。在此设置中成功构建 dev container features 即表示完成。

由索引模型根据 Issue 内容生成。

描述

When using vscode on Flatpak with podman and devcontainers as suggested here, builing of devcontainer feature fails.

The cause is that this involves building a container image with a build context which is not shared with the host:

[1/2] STEP 3/4: COPY --from=dev_containers_feature_content_source devcontainer-features.builtin.env /tmp/build-features/
Error: building at STEP "COPY --from=dev_containers_feature_content_source devcontainer-features.builtin.env /tmp/build-features/": checking on sources under "/tmp/devcontainercli-user/container-features/0.79.0-1753825289342": error in copier subprocess: changing to intended-new-root directory "/tmp/devcontainercli-user/container-features/0.79.0-1753825289342": chdir /tmp/devcontainercli-user/container-features/0.79.0-1753825289342: no such file or directory
Stop (729 ms): Run: podman-remote buildx build --load --build-context dev_containers_feature_content_source=/tmp/devcontainercli-user/container-features/0.79.0-1753825289342 --no-cache --build-arg _DEV_CONTAINERS_BASE_IMAGE=mcr.microsoft.com/devcontainers/go:1-1.23-bookworm --build-arg _DEV_CONTAINERS_IMAGE_USER=root --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp --target dev_containers_target_stage -f /tmp/devcontainercli-user/container-features/0.79.0-1753825289342/Dockerfile.extended -t vsc-mycode-e878bb43015990a9f48c5b2226813a3b60f7a9ab826928aad91c912747c3bc3c-features /var/home/user/.var/app/com.visualstudio.code/config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data/empty-folder
Error: Command failed: podman-remote buildx build --load --build-context dev_containers_feature_content_source=/tmp/devcontainercli-user/container-features/0.79.0-1753825289342 --no-cache --build-arg _DEV_CONTAINERS_BASE_IMAGE=mcr.microsoft.com/devcontainers/go:1-1.23-bookworm --build-arg _DEV_CONTAINERS_IMAGE_USER=root --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp --target dev_containers_target_stage -f /tmp/devcontainercli-user/container-features/0.79.0-1753825289342/Dockerfile.extended -t vsc-mycode-e878bb43015990a9f48c5b2226813a3b60f7a9ab826928aad91c912747c3bc3c-features /var/home/user/.var/app/com.visualstudio.code/config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data/empty-folder

Here, the failing command is:

podman-remote buildx build --load \
  --build-context dev_containers_feature_content_source=/tmp/devcontainercli-user/container-features/0.79.0-1753825289342 \
  --no-cache \
  --build-arg _DEV_CONTAINERS_BASE_IMAGE=mcr.microsoft.com/devcontainers/go:1-1.23-bookworm \
  --build-arg _DEV_CONTAINERS_IMAGE_USER=root \
  --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp \
  --target dev_containers_target_stage \
  -f /tmp/devcontainercli-user/container-features/0.79.0-1753825289342/Dockerfile.extended \
  -t vsc-mycode-e878bb43015990a9f48c5b2226813a3b60f7a9ab826928aad91c912747c3bc3c-features \
  /var/home/user/.var/app/com.visualstudio.code/config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data/empty-folder

and it fails because the build context is not accessible from the host, where podman is running.

主要语言
Shell
星标
218
派生
80
平均合并
6 天 3 小时
30 天内合并 PR
2

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

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

flathub/com.visualstudio.code 的其他 Issue

查看 flathub/com.visualstudio.code 的全部 Issue

相似的 Issue

更多 Shell/Bash Issue

把新 issue 发到你的邮箱

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