Skip to content

Build cache#1088

Open
featheredtoast wants to merge 3 commits into
mainfrom
build-cache
Open

Build cache#1088
featheredtoast wants to merge 3 commits into
mainfrom
build-cache

Conversation

@featheredtoast

Copy link
Copy Markdown
Member

Add build cache to builds, cache to ghcr. Cache by current date.

Refactor bake config: remove references to arch, and split up bake configuration to be able to compose image building into parts:

  • base bake
  • push
  • cache-read
  • cache-write

Allows for cache-read on PR, cache-read+write on main builds, push after tests on main.

For caching, we unfortunately explicitly need to run docker buildx bake TARGET for EVERY target individually. Targeting a group or multiple targets at the same time results in cache misses with seemingly no rhyme or reason - I'm guessing that despite each target having a separate cache-from/cache-to config, the cache-* sections are all grouped together across the entire build. Docker build caches apparently take the first matching cache, and discard the rest despite a cache-hit being possibly available in a different cache.

Allow cache to be flushed by searching for untagged images on ghcr, and delete

Fix test build to build every step from slim, previously the test release would build from base:release. Now it builds from the previous test build step

Publish runtime-deps-only image

prefer COPY to ADD as COPY for explicitly for copying docker contexts.

allow for push and cache to be done by including bake config

do local caching, for github actions cache. introduce datestamp for cache key

use datestamps for cache invalidation
cleanup and remove untagged images from ghcr

skip if cleanup token is not set
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant