forked from RoushTech/docker
Give bake a registry-backed layer cache #46
Loading…
Reference in a new issue
No description provided.
Delete branch "ci/registry-layer-cache"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Scoping (#44) cut how many images a push rebuilds. This cuts what rebuilding one of them costs: every bake target gets a cache ref of its own on git.grey.ooo, so a cold builder can import layers instead of redoing multi-arch work under QEMU.
56 targets, 56 distinct refs, checked for collisions (45 in
default, 11 inubuntu; none missingcache-fromorcache-to).Who writes it
mainwrites, every branch only reads. A branch that could write would let unreviewed code poison every later build, and branch runs have no business holding those credentials.It cannot fail a build
The cache is an optimisation, so it is wired so a registry that is down -- or credentials a branch run cannot see -- costs time, not a red build:
continue-on-errorcache-fromimport failures are already non-fatal in buildxcache-tocarriesignore-error=true, so a hiccup cannot break a publish onmainAn unauthenticated run just builds cold, exactly as today.
Off by default
CACHE_REFdefaults to empty, so./bakeon a laptop needs no credentials and behaves as before. Only CI sets it. Verified all three modes resolve: off, read-only (branch), read+write (main).Interaction with scoped builds
changed-targetsnow stripscache-from/cache-tobefore comparing resolved bake config -- where the layer cache lives says nothing about what an image contains, so retargeting it must not rebuild all 56. Verified both directions:nodetargetnode-22 node-24Not covered here
The test job builds through compose, a separate path that bake's cache config does not reach, and its
build.targetnames do not line up 1:1 with bake target names (bakealpine-15vs compose targetalpine-15-base). Sincebuildneedstest, that is where the rest of the wall clock is -- it needs its own change.Rebased onto main after #45 so this run queues in the single concurrency lane rather than racing whatever else is in flight.
🤖 Generated with Claude Code