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

Open Beginner friendly
#653 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@sylvesterkaczmarek is already working on this.

Since Nov 6, 2026.

  • #654 by @sylvesterkaczmarek — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
75/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
docker-compose, typescript, vscode
Domain
devtools

Research direction

The issue traces the value through getComposeEnvFile and composeGroup, but does not name their source files or tests. Start by locating those entry points and checking how Compose Down builds its arguments from environmentFile. Preserve the label's file order while emitting one --env-file argument per path; verify the generated command with a regression test for two files.

Written by the indexing model from the issue text.

Description

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.

Dominant language
TypeScript
Stars
147
Forks
93
Avg merge
9h 16m
Merged PRs (30d)
14

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/vscode-containers

All issues in microsoft/vscode-containers

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.