[Proposal] Expose the container name in remoteEnv
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 15/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- docker, docker-compose
调研方向
This is a specification proposal, so there are no code files yet; the relevant text is the remoteEnv and variable-substitution sections of the devcontainer.json spec. Read the related issues linked in the body (spec #184 and #692) to see what has already been decided about container naming. Done means a written proposal that defines when ${containerName} is resolved, covers Docker Compose primary services, and is discussed by maintainers.
由索引模型根据 Issue 内容生成。
描述
A process running in a devcontainer may need its container’s runtime name for logging or tracking purposes. Today, there is no way to reference that name in remoteEnv. The name field in devcontainer.json is a display name and may differ from the name shown by Docker or Podman.
Add a ${containerName} variable that can be used in remoteEnv:
{
"remoteEnv": {
"DEVCONTAINER_CONTAINER_NAME": "${containerName}"
}
}
${containerName} should resolve to the actual runtime name of the primary development container. It should work for both newly created and reused containers, including the primary service in a Docker Compose setup. The tool should resolve it before running lifecycle commands or starting other processes to which remoteEnv applies.
This does not change how containers are named. Because the value is only known after container creation, ${containerName} would not be available in creation-time settings such as containerEnv or runArgs.
Related requests: container name in devcontainer.json (https://github.com/devcontainers/spec/issues/184) and a CLI option to choose the name (https://github.com/devcontainers/spec/issues/692).
- 主要语言
- 没有语言数据
- 星标
- 5.8k
- 派生
- 503
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
devcontainers/spec 的其他 Issue
-
CLI sorts Feature options fewest-first, against spec可能已有人在做 @nozaq 于 85 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
devcontainers/spec#755 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
devcontainers/spec#754 · 1 条评论 · 2 个 reaction ·
-
难度 2/5 1-3 小时 新手友好度 64/100
devcontainers/spec#735 · 1 条评论 ·
-
难度 1/5 1 小时以内 新手友好度 62/100
devcontainers/spec#579 · 1 条评论 ·
-
难度 5/5 一周以上 新手友好度 15/100
devcontainers/spec#777 ·
查看 devcontainers/spec 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 66/100
netlify/netlify-mcp#75 ·
维护者通常 1 天内回复
-
area:ide bug platform:vscode platform:windows
难度 2/5 1-3 小时 新手友好度 68/100
anthropics/claude-code#101482 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
atlassian-labs/compiled#1960 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 84/100
维护者通常 2 天内回复
-
TUI crash: undefined is not an object (evaluating 'r.text.feedback[t.toast.variant].base')可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭reproduced
难度 2/5 1-3 小时 新手友好度 76/100
anomalyco/opencode#54762 · 1 条评论 ·
维护者通常 1 天内回复