Skip to content

Drop the automatic GitHub Actions cache, add a parallel build keeping the cache of services sharing a stage - #24

Merged
joelwurtz merged 5 commits into
mainfrom
fix/cache-to-docker-driver
Oct 6, 2026
Merged

joelwurtz merged 5 commits into
mainfrom
fix/cache-to-docker-driver

Conversation

@joelwurtz

@joelwurtz joelwurtz commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

0.9.0 backed every registry cache with a GitHub Actions one on CI, to make up for the registry cache missing layers at random (jolicode/docker-starter#430). That miss is a BuildKit race instead (moby/buildkit#6418), detailed in jolicode/docker-starter#448:

  • services built together in one bake session, which share a stage (an application and its builder sharing php-base), each import a cache describing that stage. BuildKit keeps one of them and randomly rebuilds the steps of the other services;
  • a second cache on the same target races the same way, so the GitHub Actions cache made it worse;
  • the docker driver of the runners also failed every build exporting it (Cache export is not supported for the docker driver).

Changes

  • Removed the automatic GitHub Actions cache: a service only gets the registry cache of withRegistryCache(), as before 0.9.0, plus whatever is given to its cacheFrom().
  • Added docker:build --parallel and the build_parallel context variable: each service builds in its own session, all of them in parallel, and its log is printed once it is done. docker:up --build and docker:push follow them, --no-parallel turns it off for one command.

Measured

On jolicode/redirection.io CI (11 services, the builder stage was rebuilt on almost every run and on every cache push):

Build infrastructure builder stage
one docker compose build 83s rebuilt
one build per service, registry + GitHub Actions cache 119s rebuilt
one build per service, registry cache only 53s cached

@joelwurtz joelwurtz changed the title Only write the GitHub Actions cache when the builder can export a cache Fit the GitHub Actions cache to the builder, and let the builds skip writing their cache Oct 6, 2026
@joelwurtz joelwurtz changed the title Fit the GitHub Actions cache to the builder, and let the builds skip writing their cache Drop the automatic GitHub Actions cache, add a parallel build keeping the cache of services sharing a stage Oct 6, 2026
@joelwurtz
joelwurtz merged commit 7cbb252 into main Oct 6, 2026
5 checks passed
@joelwurtz
joelwurtz deleted the fix/cache-to-docker-driver branch October 6, 2026 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant