Add `dockerComposeArgs` to allow passing `--env-file` to `dockerComposeFile`

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

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
68/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
冷清
技术栈
docker, docker-compose
领域
devops

调研方向

首先追踪 devcontainer.json 如何处理 dockerComposeFile,以及 Docker Compose 命令如何组装。检查 issue 中描述的 docker-compose.yaml 区别,然后验证 dockerComposeArgs 是否可以传递 --env-file,以及最终的 Compose 解析是否使用所提供的环境文件。

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

描述

docker compose up accepts a --env-file to point to a .env file and set its contents as env vars, which are available when parsing the docker-compose.yaml. note that this is different from the env_file config option in docker-compose.yaml, which only sets env vars inside the container.

when providing dockerComposeFile in devcontainer.json there is currently no way to pass --env file.

suggestion (following https://github.com/microsoft/vscode-remote-release/issues/4885#issuecomment-2408558170):

{
  "dockerComposeFile": ["a.compose.yaml", "b.compose.yaml"],
  "dockerComposeArgs": ["--env-file custom.env"]
}
主要语言
没有语言数据
星标
5.8k
派生
509
PR 合并指标
30 天内没有已合并 PR

环境准备

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

从这里开始

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

devcontainers/spec 的其他 Issue

查看 devcontainers/spec 的全部 Issue

相似的 Issue

更多 DevOps Issue

把新 issue 发到你的邮箱

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