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

Đang mở Phù hợp với người mới
#653 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@sylvesterkaczmarek đang làm issue này rồi.

Từ ngày 6/11/2026.

  • #654 của @sylvesterkaczmarek — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
75/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
docker-compose, typescript, vscode
Lĩnh vực
devtools

Hướng nghiên cứu

Issue theo dấu giá trị qua getComposeEnvFile và composeGroup, nhưng không nêu tên các tệp nguồn hoặc bài kiểm thử. Hãy bắt đầu bằng cách xác định các điểm vào đó và kiểm tra cách Compose Down tạo các đối số từ environmentFile. Giữ nguyên thứ tự tệp trong nhãn và xuất một đối số --env-file cho mỗi đường dẫn; xác minh lệnh được tạo bằng một bài kiểm thử hồi quy cho hai tệp.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
TypeScript
Star
147
Fork
93
Merge trung bình
9 giờ 16 phút
Pull request đã merge (30 ngày)
14

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của microsoft/vscode-containers

Tất cả issue của microsoft/vscode-containers

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.