[FEATURE] Report all missing required environment variables in a single error
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 42/100
Hướng nghiên cứu
Start by tracing environment variable interpolation and required-variable validation in Docker Compose; the issue names no source files or tests. Check how docker compose config and docker compose up handle multiple missing variables, then identify the relevant tests. Done means both commands report all missing required variables together and start no containers when validation fails.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
When a Compose file contains multiple required environment variables, Docker Compose stops at the first missing variable during interpolation.
This means users must repeatedly run docker compose up, fix one variable, and run the command again to discover the next missing variable.
It would be helpful to collect all missing required variables and report them together before exiting.
Example
services:
app:
image: alpine:latest
environment:
DB_HOST: ${DB_HOST:?DB_HOST is required}
DB_PASSWORD: ${DB_PASSWORD:?DB_PASSWORD is required}
API_KEY: ${API_KEY:?API_KEY is required}
With all three variables unset, run:
docker compose up
Current behavior
Compose exits after reporting a single missing required variable. The remaining missing variables are discovered only on subsequent attempts.
Expected behavior
Compose validates all required variables and returns one consolidated error, for example:
Configuration validation failed:
- DB_HOST: DB_HOST is required
- DB_PASSWORD: DB_PASSWORD is required
- API_KEY: API_KEY is required
No containers should be started when validation fails.
This behavior would be useful for both docker compose up and docker compose config.
Benefits
- Reduces repeated configuration attempts.
- Makes initial setup easier for projects with many required variables.
- Provides clearer feedback in CI/CD logs.
Docker Compose version
PS C:\Users\<user>> docker compose version
Docker Compose version v5.3.1
PS C:\Users\<user>> docker version
Client:
Version: 29.6.2-rd
API version: 1.55
Go version: go1.26.4
Git commit: ede120b
Built: Fri Jul 17 17:00:40 2026
OS/Arch: windows/amd64
Context: default
- Ngôn ngữ chính
- Go
- Star
- 38.9k
- Fork
- 6k
- Merge trung bình
- 2 ngày 22 giờ
- Pull request đã merge (30 ngày)
- 81
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của docker/compose
-
[BUG] `docker compose port` prints `:0` (exit 0) for a port the image exposes but the service does not publishCó thể đã có người làm @ndeloof đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
docker/compose#14435 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] deploy.restart_policy without condition drops the restart policyCó thể làm lại được @akshat-lakhera đã nhận 25 ngày trước và không có pull request nào đang mở. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
docker/compose#14383 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] up: an optional (required: false) service_healthy dependent is not started when a required dependent shares the failing waitCó thể đã có người làm @ndeloof đã nhận 2 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 58/100
docker/compose#14507 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] Negative replica count in scale flags (docker compose scale / --scale) is accepted without validationCó thể đã có người làm @arsalanyavari đã nhận 8 ngày trước. Đang mởkind/bug status/approved
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 30/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của docker/compose
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
IBM-Cloud/terraform-provider-ibm#7115 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
fluxcd/notification-controller#1441 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
volcengine/volcengine-go-sdk#163 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
OneBusAway/maglev#2145 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
priority/medium status/ready type/chore
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
discobox-ai/discobox#1357 ·
Maintainer thường phản hồi trong vòng 1 ngày