Improve container image build performance#90
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR optimizes container build and CI performance by reducing unnecessary multi-arch work in pull requests, improving Docker build caching, tightening the build context, and hardening the runtime image.
Changes:
- Build only
linux/amd64for PRs while keeping multi-arch builds for pushes/tags. - Speed up Docker builds via BuildKit cache mounts and a smaller build context (
.dockerignore). - Produce a slimmer runtime image by building a static binary and running as a non-root user.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
docker/Dockerfile |
Adds BuildKit cache mounts, builds a static binary, and switches runtime to non-root. |
.github/workflows/build-container-image.yaml |
Skips QEMU on PRs and conditionally limits PR builds to linux/amd64; adjusts cache/provenance settings. |
.dockerignore |
Reduces Docker build context size by excluding VCS/editor/dev artifacts and built docs output. |
.gitignore |
Ignores local .cache artifacts. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
linux/amd64in CI while keeping multi-arch builds for pushes and tags.cacheartifacts generated during developmentWhy
The container image workflow was spending unnecessary time on emulated multi-platform builds in pull requests.
This change keeps release builds intact while making PR validation faster and tightening the runtime image setup.