Repository navigation
ci(sandbox): reuse the published image when its Dockerfile is unchanged - #174
Merged
Merged
Conversation
Every release rebuilt the sandbox image from scratch, and apt produced new layers each time, so each mikan release meant a ~940 MB download even with an unchanged Dockerfile. A release now tags the published image with its version when the Dockerfile hash matches and the image is under 30 days old, so tools still refresh about monthly. Releases publish only :<version>, plus :latest for stable releases; the sha-, tools, beta, and edge tags had no readers.
Deploying mikan with
|
| Latest commit: |
431a205
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://d9c358b6.mikan-1wv.pages.dev |
| Branch Preview URL: | https://ci-sandbox-image-reuse.mikan-1wv.pages.dev |
The created time renders with spaces, and an image published before the inputs label renders it empty; a pipe-separated line with Unix seconds keeps every field in place.
geminixiang
force-pushed
the
ci/sandbox-image-reuse
branch
from
October 11, 2026 08:08
4a44f30 to
1750042
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
為什麼要改
每次發版都會從頭重建 sandbox image,
apt-get每次都產生新的層。結果即使 Dockerfile 完全沒改,每個新版本都有約 936 MB 的新內容。實測 1.0.2 到 1.3.0 每一版都是這樣。接下來 mikan 會改成使用和版號對應的 image(PR 2),如果不先處理這個問題,使用者每次升級 mikan 都要重新下載約 1 GB,所有 container 也都要重建。
改了什麼
imagetools create),下載量為 0,container 也不會因此重建sha-*、latest、<version>、tools,預覽版另加beta<version>;正式版另外更新latest「建置超過 30 天就重建」讓 gh、gcloud 等工具大約每月更新一次,不需要另外排定每月的自動建置。
判斷要不要沿用的步驟在 PR 上也會執行,只輸出判斷結果,不會推送。
已知限制
latest,也就是最新的正式版。Dockerfile 改了之後、下一個正式版發佈之前,每個預覽版都會重建一次。org.opencontainers.image.versionlabel 會是原本建置時的版號。已完成的 package 整理(不在這個 PR 裡)
mama-sandbox、mikan、mikan-agent-sandbox-router、mikan-agent-sandbox-runtime、charts/mikan。mikan-sandbox從 1,244 個版本整理到 40 個:只保留 1.x 正式版(1.0.0 到 1.3.0)和它們底下的各架構 image。已確認保留的每個版本都能正常 pull。驗證
latest沒有 Dockerfile hash label,所以預期結果是「重建」。這個 PR 只改 CI 和文件,不影響 Slack 訊息經過 daemon 的路徑,所以不需要跑 Slack E2E。