Fix expiry time for Git SHA tagged Docker images
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
- 52/100
Hướng nghiên cứu
Bắt đầu với .github/workflows/build-image.yaml, sau đó kiểm tra label của Dockerfile và thiết lập QUAY_IMAGE_EXPIRY của Makefile. So sánh cách workflow xử lý tag và thời hạn hết hạn với tài liệu về hết hạn image của Quay, đồng thời xác nhận rằng các tag main, latest và release không bao giờ hết hạn, trong khi các tag Git SHA hết hạn sau 3 tuần mà không thay đổi hành vi của branch-tag.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
Docker images tagged with Git SHA are not expiring as expected on Quay.io. Currently, SHA-tagged images are set to never expire, leading to storage accumulation.
Current Behavior
Looking at quay.io/kuadrant/developer-portal-controller, images with Git SHA tags (e.g., b2ab687...) do not have an expiry time set.
Expected Behavior
Images should automatically expire based on their tags:
- Images with
maintag: Never expire - Images with
latesttag: Never expire - Release tag images (e.g.,
v0.4.0,v1.2.3-alpha.1): Never expire - Git SHA tagged images: Expire after 3 weeks
- Branch tagged images (non-main branches): Expire after 3 weeks ✅ (already working correctly)
Root Cause
The issue is in .github/workflows/build-image.yaml. When a push to the main branch occurs:
- The metadata action generates multiple tags for a single build:
main,latest, and the Git SHA - The expiry logic evaluates to
expiry=neverbecausegithub.ref_name == "main" - The Docker build uses a single
QUAY_IMAGE_EXPIRYvalue for all tags via theLABEL quay.expires-afterdirective - Result: All tags including the Git SHA inherit
quay.expires-after=never
This is a Docker/Quay limitation - you cannot set different expiry times for different tags in the same image build because the label is set at the image layer level, not per-tag.
Possible Solutions
Option 1: Separate Builds for Different Expiry Requirements
Split the image building into separate jobs with different QUAY_IMAGE_EXPIRY build args:
- Job 1: Build and tag with
mainandlatest(expiry = never) - Job 2: Build and tag with Git SHA (expiry = 3w)
Option 2: Use Quay API to Set Tag Expiry Post-Build
After the image is built and pushed, use the Quay API to programmatically set expiration time for the Git SHA tag only.
Additional Context
- Current Makefile setting:
QUAY_IMAGE_EXPIRY ?= 3w - Dockerfile label:
LABEL quay.expires-after=$QUAY_IMAGE_EXPIRY - Quay.io documentation on image expiration: https://docs.quay.io/guides/image-expiration.html
- Ngôn ngữ chính
- Go
- Star
- 3
- Fork
- 15
- Merge trung bình
- 1 ngày 21 giờ
- Pull request đã merge (30 ngày)
- 4
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Có Dockerfile hoặc tệp Docker Compose
- Không 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 Kuadrant/developer-portal-controller
-
documentation linkinator-failure
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
-
Add reference documentation for APIKeyRequest CRDCó thể đã có người làm @amalsaidov đã nhận 19 ngày trước. Đang mởdocumentation good first issue triage/accepted
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 74/100
-
triage/accepted
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Kuadrant/developer-portal-controller#83 · 1 bình luận ·
-
Add unit tests for name generation, data transformation, and object helpersCó thể làm lại được @VISHNU0906 đã nhận 19 ngày trước và không có pull request nào đang mở. Đang mởenhancement good first issue triage/accepted
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 72/100
Kuadrant/developer-portal-controller#76 · 1 bình luận ·
-
Add unit tests for status and condition helper functionsCó thể làm lại được @aviralgarg05 đã nhận 21 ngày trước và không có pull request nào đang mở. Đang mởenhancement good first issue triage/accepted
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 68/100
Kuadrant/developer-portal-controller#75 · 1 bình luận ·
Tất cả issue của Kuadrant/developer-portal-controller
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
alibaba/MongoShake#1077 ·
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 75/100
mattermost/mattermost-plugin-jira#1397 · 1 bình luận ·
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 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
Maintainer thường phản hồi trong vòng 3 ngày
-
Add Free CS Systems Workshops, Starter Scaffolds & Zero-Dependency Verification CLI to CS SeriesĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100