Skip to content

Comments

feat(builds): configure local registry as Docker Hub mirror in BuildKit#88

Closed
hiroTamada wants to merge 1 commit intomainfrom
feat/buildkit-registry-mirror
Closed

feat(builds): configure local registry as Docker Hub mirror in BuildKit#88
hiroTamada wants to merge 1 commit intomainfrom
feat/buildkit-registry-mirror

Conversation

@hiroTamada
Copy link
Contributor

Summary

  • Adds [registry."docker.io"] mirrors = ["{local-registry}"] to the generated buildkitd.toml in the builder agent
  • When BuildKit encounters FROM node:20-alpine (or any docker.io image), it tries the local registry first, falling back to Docker Hub if not found
  • This is a simpler alternative to Dockerfile FROM rewriting — BuildKit handles mirror resolution natively, including multi-stage builds, ARG variables, etc.

Prerequisites for production testing

Base images need to be available in the local registry for the mirror to provide a hit. This can be done by pulling them into hypeman's registry ahead of time (e.g., via the images API).

Test plan

  • Deploy to production
  • Run an admin build with global_cache_key=node to populate the global cache
  • Pull node:20-alpine into the local registry (if not already there)
  • Run a non-admin build using FROM node:20-alpine and check builder VM logs — BuildKit should try the local registry first
  • Verify fallback: run a build with an image NOT in the local registry — should still pull from Docker Hub

🤖 Generated with Claude Code

Add docker.io mirror configuration to the generated buildkitd.toml so
BuildKit tries the local registry first when pulling base images (e.g.,
FROM node:20-alpine). Falls back to Docker Hub if not found locally.

This avoids redundant Docker Hub pulls when base images have already
been mirrored to the local registry, without needing Dockerfile
rewriting or other application-level workarounds.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@hiroTamada hiroTamada closed this Feb 11, 2026
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