Add fallback registry support and alternative image mapping in docker-compose
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ó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 32/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- docker, docker-compose, go
- Lĩnh vực
- devops, infrastructure
Hướng nghiên cứu
Không có tệp, kiểm thử hay entry point nào được nêu tên. Hãy bắt đầu bằng cách lần theo cách docker-compose phân tích cấu hình image của service và xử lý việc pull image, sau đó tìm các kiểm thử cấu hình và tích hợp hiện có. Done phải bao gồm một schema cấu hình đã được thống nhất, hành vi khi fallback thất bại được xác định rõ và các kiểm thử bao quát những lần thử với registry chính và registry fallback.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
This feature request proposes adding native support in docker-compose for defining multiple container registries (primary and fallback) and enabling automatic failover when the primary registry is unavailable. It also introduces optional alternative image mappings per registry.
Problem
Currently, docker-compose only supports a single image reference per service:
services:
app:
image: myorg/myapp:1.0
If the primary registry (e.g. Docker Hub) becomes unavailable due to outage, rate limiting, or network issues, deployments fail immediately.
There is no built-in mechanism for:
- Automatic fallback to another registry (e.g. GHCR, ECR)
- Defining alternative image locations
- Transparent retry logic for image pulls
This forces users to rely on external scripts or CI/CD logic, increasing complexity and reducing reliability.
Proposed Solution
1. Global registry fallback configuration
x-registries:
primary: docker.io
fallback: ghcr.io
2. Service-level fallback image definition
services:
app:
image:
primary: myorg/myapp:1.0
fallback: ghcr.io/myorg/myapp:1.0
3. Automatic fallback behavior
When pulling images:
- Attempt to pull from primary registry
- If it fails (network error, timeout, 5xx errors):
- Automatically retry using fallback image
Example:
docker pull myorg/myapp:1.0
→ fails
docker pull ghcr.io/myorg/myapp:1.0
→ succeeds
4. Optional registry mapping per service
services:
app:
image: myorg/myapp:1.0
registry_fallback:
docker.io: myorg/myapp:1.0
ghcr.io: ghcr.io/myorg/myapp:1.0
Expected Behavior
- Primary registry is always attempted first
- Fallback registry is automatically used on failure
- No manual intervention required
- Works transparently with
docker compose up
Benefits
- Improved deployment reliability
- Resilience against registry outages (e.g. Docker Hub downtime)
- Simplified multi-registry strategies
- Better CI/CD and production robustness
- Reduced need for custom scripting
Use Cases
- Production systems requiring high availability
- CI/CD pipelines using multiple registries
- Organizations mirroring images across Docker Hub and GHCR
- Edge environments with unstable connectivity
- Disaster recovery scenarios
Alternatives Considered
- CI/CD-based image rewriting
- Manual multi-registry tagging and pushing
- Kubernetes-based imagePullPolicy strategies
These approaches are either external, complex, or not integrated into docker-compose workflows.
Summary
This feature would enhance docker-compose by adding native registry failover support, improving resilience and simplifying multi-registry deployments while preserving declarative configuration.
- 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 86/100
fluxcd/notification-controller#1441 ·
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 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
-
TestPseudoLocaleRemote fails now and then: it types the code before the laptop asks for itCó thể đã có người làm @fzn0x đã nhận hôm nay. Đang mởbug priority: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
edit_file diff rendering panics on invalid UTF-8 textCó thể đã có người làm @TDnorthgarden đã nhận hôm nay. Đang mởarea/tui
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
docker/docker-agent#4955 ·
Maintainer thường phản hồi trong vòng 1 ngày