[build] Wire up SONIC_USE_DOCKER_BUILDKIT for parallel Docker layer builds#25705
Closed
rustiqly wants to merge 1 commit intosonic-net:masterfrom
Closed
[build] Wire up SONIC_USE_DOCKER_BUILDKIT for parallel Docker layer builds#25705rustiqly wants to merge 1 commit intosonic-net:masterfrom
rustiqly wants to merge 1 commit intosonic-net:masterfrom
Conversation
…uilds SONIC_USE_DOCKER_BUILDKIT has existed as a config variable since it was added, but was never wired up to actually enable BuildKit. The variable is passed to the slave container (Makefile.work) and printed in the build config summary (slave.mk), but DOCKER_BUILDKIT=1 is never exported. This change: - Adds the config knob to rules/config (default: off) - Exports DOCKER_BUILDKIT=1 in slave.mk when enabled BuildKit provides: - Parallel layer builds within each Docker image - Better cache management - Improved build output with progress tracking - Available on Docker 18.09+ (all supported build hosts) When combined with Docker cache (SONIC_CONFIG_USE_DOCKER_CACHE), BuildKit enables inline cache metadata for efficient layer reuse across builds. Signed-off-by: Rustiqly <[email protected]>
Contributor
Author
|
Closing this — after digging into the history, BuildKit is already the default on all active build environments. Full history of SONIC_USE_DOCKER_BUILDKIT:
Current state: All active build environments use Docker 24.0.2+ (bookworm/trixie slave) or Docker 29.x (host in DooD mode). Docker 23+ has BuildKit enabled by default. Nobody sets The dead variable ( |
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 I did
Wired up the existing
SONIC_USE_DOCKER_BUILDKITconfig variable to actually enable Docker BuildKit by exportingDOCKER_BUILDKIT=1.Why I did it
SONIC_USE_DOCKER_BUILDKIThas existed as a config variable — it's passed to the slave container (Makefile.workline 572) and printed in the build config summary (slave.mkline 428) — but was never wired up to actually setDOCKER_BUILDKIT=1. The variable is a dead config knob.Docker BuildKit provides:
RUN/COPYsteps execute concurrently)How I did it
rules/config(default: off/commented out)export DOCKER_BUILDKIT := 1inslave.mkwhenSONIC_USE_DOCKER_BUILDKIT=yThe change is minimal — just exporting an environment variable that Docker picks up automatically for all
docker buildcommands.How to verify it
When combined with Docker cache (
SONIC_CONFIG_USE_DOCKER_CACHE), BuildKit enables inline cache metadata for efficient layer reuse across builds.