Compose Down fails for projects started with multiple --env-file arguments

オープン 初心者向け
#653 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@sylvesterkaczmarek がすでに取り組んでいます。

2026年11月6日 から。

  • #654 @sylvesterkaczmarek による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
75/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
docker-compose, typescript, vscode
領域
devtools

調査の方向性

IssueではgetComposeEnvFileとcomposeGroupを通じて値をたどっていますが、ソースファイルやテストは示されていません。まずこれらのエントリポイントを特定し、Compose DownがenvironmentFileからどのように引数を構築するかを確認してください。ラベルに記載されたファイルの順序を保ち、各パスにつき--env-file引数を1つ出力してください。2つのファイルを対象とする回帰テストで、生成されたコマンドを検証してください。

索引モデルが issue の本文から書いたものです。

説明

When a Compose project is started with multiple environment files, selecting Compose Down from the project's context menu in the VS Code Containers view fails.

Container Tools reads the comma-separated com.docker.compose.project.environment_file label and passes its entire value as a single --env-file argument.

Steps to reproduce
  1. Start a Compose project with two environment files: docker compose --env-file .env --env-file override.env up -d
  2. Open the Containers view in VS Code.
  3. Right-click the running Compose project.
  4. Select Compose Down.
Actual behavior

The extension generates a command containing: --env-file '/path/to/.env,/path/to/override.env'

Compose treats this as a single filename and fails: couldn't find env file: /path/to/.env,/path/to/override.env

Expected behavior

The extension should handle multiple environment files and generate a separate argument for each: --env-file '/path/to/.env' --env-file '/path/to/override.env'

The original file order should be preserved so that environment variable precedence remains unchanged.

Investigation

The running containers have this label: com.docker.compose.project.environment_file=/path/to/.env,/path/to/override.env

In the installed extension bundle, getComposeEnvFile returns the label unchanged, and composeGroup passes that string as environmentFile.

Environment

Container Tools: 2.5.3 (ms-azuretools.vscode-containers)
Docker extension: 2.0.0 (ms-azuretools.vscode-docker)
Extension host: Linux, VS Code Server

Workaround

Run Compose Down manually with a separate --env-file argument for each file.

主要言語
TypeScript
スター
147
フォーク
93
平均マージ
9時間 16分
マージ済み PR(30日)
14

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/vscode-containers のほかの issue

microsoft/vscode-containers の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。