Build developers local platform by default#73
Build developers local platform by default#73austinvazquez wants to merge 1 commit intocontainerd:mainfrom
Conversation
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the build system to differentiate between host and guest artifacts, enabling developers to build artifacts for their local platform by default while maintaining support for guest (Linux) artifacts.
Key changes:
- Introduced
HOST_OSvariable and platform-specific build targets (_host_common,_guest_common) - Modified the default build group to include separate host and guest binary groups
- Updated the Makefile to detect and use the local platform for builds
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| docker-bake.hcl | Adds host/guest platform distinction with new variables and target groups, reorganizes default build targets |
| Makefile | Updates platform detection to use lowercase OS names and passes HOST_OS to the build system |
| Dockerfile | Changes cache key from TARGETPLATFORM to explicit TARGETOS/TARGETARCH format |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| output = ["${DESTDIR}"] | ||
| } |
There was a problem hiding this comment.
The libkrun target is missing an inherits declaration. Since it's part of the guest-binaries group (line 77), it should inherit from _guest_common to ensure consistent platform targeting.
| $(BUILDX) bake | ||
| build: | ||
| @echo "$(WHALE) $@" | ||
| HOST_OS=$(OS) KERNEL_ARCH=$(ARCH) $(BUILDX) bake |
There was a problem hiding this comment.
Variable naming inconsistency: KERNEL_ARCH is used here but TARGETARCH is the standard Docker build argument. Consider renaming to HOST_ARCH for consistency with HOST_OS, or document why a different convention is used.
| HOST_OS=$(OS) KERNEL_ARCH=$(ARCH) $(BUILDX) bake | |
| HOST_OS=$(OS) HOST_ARCH=$(ARCH) $(BUILDX) bake |
There was a problem hiding this comment.
I need to check this config. Putting this into draft.
|
Superseded by #74 |
This change updates the build to split artifacts into host/guest. By default, build the host artifacts to match the developers local platform.