Replace docker-image-cache.js with BuildKit registry cache#92799
Open
mmastrac wants to merge 2 commits into
Open
Replace docker-image-cache.js with BuildKit registry cache#92799mmastrac wants to merge 2 commits into
mmastrac wants to merge 2 commits into
Conversation
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
This was referenced Apr 14, 2026
62148ed to
078bc7b
Compare
Contributor
Stats from current PR✅ No significant changes detected📊 All Metrics📖 Metrics GlossaryDev Server Metrics:
Build Metrics:
Change Thresholds:
⚡ Dev Server
📦 Dev Server (Webpack) (Legacy)📦 Dev Server (Webpack)
⚡ Production Builds
📦 Production Builds (Webpack) (Legacy)📦 Production Builds (Webpack)
📦 Bundle SizesBundle Sizes⚡ TurbopackClient Main Bundles
Server Middleware
Build DetailsBuild Manifests
📦 WebpackClient Main Bundles
Polyfills
Pages
Server Edge SSR
Middleware
Build DetailsBuild Manifests
Build Cache
🔄 Shared (bundler-independent)Runtimes
📎 Tarball URL |
a7a0a54 to
b565dfd
Compare
83d6c41 to
7f6b34c
Compare
Contributor
Tests Passed |
7f6b34c to
6827a63
Compare
d417364 to
0eac0fc
Compare
0eac0fc to
53ed192
Compare
0ff43ea to
8c16bec
Compare
53ed192 to
bb3f04e
Compare
Use a reusable docker-buildx action with BuildKit registry cache backed by the turbo remote cache server. The builder is kept alive between runs on self-hosted runners so layers stay in BuildKit's local content store. Removes the old docker-image-cache.js which used zstd-compressed tarballs.
Extract the APT mirror URL from the host's /etc/apt/sources.list (e.g. Hetzner mirror) and pass it as a build arg to the Dockerfile. Speeds up apt-get on cache miss when building on Hetzner runners.
bb3f04e to
e0a47d7
Compare
bgw
approved these changes
Apr 21, 2026
| steps: | ||
| - name: Resolve cache registry | ||
| id: resolve | ||
| shell: bash -leo pipefail {0} |
Member
There was a problem hiding this comment.
It seems better to just set this to bash?
Suggested change
| shell: bash -leo pipefail {0} | |
| shell: bash |
| echo "TURBO_TOKEN=${TURBO_TOKEN}" >> "$GITHUB_ENV" | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 |
Member
There was a problem hiding this comment.
- It looks like there's already a v4 of this action?
- Pin it to an exact commit hash.
| echo "$CONFIG" | node -e " | ||
| const c = JSON.parse(require('fs').readFileSync('/dev/stdin','utf8')); | ||
| c.auths = c.auths || {}; | ||
| c.auths['${REGISTRY}'] = { auth: '${AUTH}' }; |
Member
There was a problem hiding this comment.
Use them as environment variables to avoid escaping issues?
Suggested change
| c.auths['${REGISTRY}'] = { auth: '${AUTH}' }; | |
| c.auths[process.env.REGISTRY] = { auth: process.env.AUTH }; |
Comment on lines
+67
to
+80
| - name: Detect host APT mirror | ||
| id: apt-mirror | ||
| shell: bash | ||
| run: | | ||
| # Extract the mirror base URL from the host's sources.list. | ||
| # Hetzner uses: http://mirror.hetzner.com/ubuntu/packages | ||
| # We grab everything before the suite name (jammy, focal, etc). | ||
| MIRROR=$(grep -oP 'https?://\S+(?=\s+(focal|jammy|noble)\b)' /etc/apt/sources.list 2>/dev/null | head -1) | ||
| if [ -n "$MIRROR" ]; then | ||
| echo "url=${MIRROR}" >> "$GITHUB_OUTPUT" | ||
| echo "Detected host APT mirror: ${MIRROR}" | ||
| else | ||
| echo "url=" >> "$GITHUB_OUTPUT" | ||
| fi |
Member
There was a problem hiding this comment.
Honestly, I'd rather just hardcode this value, as it's easier to understand if things go wrong.
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.

What
Use a buildkit registry (hosted on top of our turborepo cache emulator) rather than forcing docker to get cached using turborepo.
Why
Buildkit is smarter about layers and can do a lot less work if the local runner has some of the images.