Optimize Debian image footprint using multi-stage builds#649
Merged
YonathanZetune merged 1 commit intoJun 12, 2026
Merged
Conversation
11ffaae to
ecdedc3
Compare
maythazin5
reviewed
Jun 12, 2026
maythazin5
approved these changes
Jun 12, 2026
This change optimizes the footprint of the Debian-based Cloud SDK Docker images using multi-stage builds.
It also includes the following fixes:
- Pin tonistiigi/binfmt to sha256:400a4873b838d1b89194d982c45e5fb3cda4593fbfd7e08a02e76b03b21166f0 (qemu-v10.2.3-68) for stability and security.
- Remove default '=amd64' from global ARG TARGETARCH and use ${TARGETARCH:-amd64} in FROM base-${TARGETARCH} to support correct platform resolution in BuildKit while falling back gracefully on legacy builders.
- Skip execution of emulated gcloud/kubectl version checks (which fail on 64KB page size hosts under QEMU user emulation due to 4KB segment alignment of bundled Python) by checking if target arch matches build arch.
- Write gcloud configurations directly to config files at build time to avoid running gcloud commands under emulation.
ecdedc3 to
5834dcd
Compare
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.
Optimize Debian image footprint using multi-stage builds