[FEATURE] Report all missing required environment variables in a single error

Đang mở
#14,471 2 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

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
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
docker-compose, go
Lĩnh vực
cli

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ả

kind/feature status/0-triage
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

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 docker/compose

Tất cả issue của docker/compose

Issue tương tự

Thêm issue về Go

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.