Podman fix: derive `--userns=keep-id` mapping from the remote user's actual UID/GID
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 58/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- typescript
调研方向
首先追踪 Dev Containers CLI 在哪里注入原始的 --userns=keep-id 参数,以及它如何解析镜像内的 remoteUser。针对较高的主机 UID/GID 以及主机和容器 ID 匹配的情况,验证生成的 Podman 参数,确保这两种情况下都保留预期的 workspace 权限。
由索引模型根据 Issue 内容生成。
描述
The problem
When running a dev container with rootless podman, the Dev Containers CLI injects a plain --userns=keep-id flag, which maps the host user id to the same UID number inside the container.
This breaks for high/out-of-range host UIDs (e.g. AD/SSSD users which have values like1400601154, which are not valid inside the container (they are out of range as the containers are typically given a 0-65535 range via subuid/subgid mapping). As a result the mapping fails silently and the container's vscode user remains at UID 1000, not matching the host user, and causing Permission denied on the workspace bind mount).
Current workaround
The current workaround is a fragile manual runArgs entry (--userns=keep-id:uid=1000,gid=1000). Since the host UID is unmappable to itself, we keep the 1000 id inside the container and map the host user to that. This allows one to use podman on Linux boxes with AD and thus high uid/gid combinations, as it removes the requirement for the exact host UID to be inside the container's range.
The request for improvement
Instead of injecting a plain --userns=keep-id, the CLI should resolve the remoteUser's actual UID/GID in the image and emit --userns=keep-id:uid=<remote-uid>,gid=<remote-gid>. This fixes the high-UID case with no regressions: when the host UID already equals the container user's UID, keep-id:uid=X,gid=X produces the identical mapping to plain keep-id, so existing setups are unaffected.
- 主要语言
- TypeScript
- 星标
- 3k
- 派生
- 463
- 平均合并
- 13 小时 28 分钟
- 30 天内合并 PR
- 2
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
devcontainers/cli 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 92/100
devcontainers/cli#1203 ·
维护者通常 1 天内回复
-
难度 1/5 1-3 小时 新手友好度 68/100
devcontainers/cli#1178 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 68/100
devcontainers/cli#1317 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 25/100
devcontainers/cli#1308 ·
维护者通常 1 天内回复
-
build rejects valid tag@digest image references during registry inspection可能已有人在做 @v-Kaniska244 于 7 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 78/100
devcontainers/cli#1307 · 2 条评论 · 1 个 reaction · 已指派 1 人 ·
维护者通常 1 天内回复
查看 devcontainers/cli 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
external-issue to-triage
难度 1/5 1 小时以内 新手友好度 90/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
diegosouzapw/OmniRoute#15401 ·
维护者通常 2 天内回复
-
Sign the pledge未关闭
难度 1/5 1 小时以内 新手友好度 95/100
input-output-hk/devx-updates#163 ·
-
难度 2/5 1-3 小时 新手友好度 86/100
code-yeongyu/oh-my-openagent#9454 ·
维护者通常 1 天内回复