feat(docker): support native multi-arch (amd64/arm64) builds#5096
Conversation
- Update Dockerfile.base to exclude prepackaged cache on arm64/aarch64 and trigger native SDK bootstrapping. - Exclude .pub-preload-cache by default on all architectures to optimize size. - Update Dockerfile to download yq dynamically based on target architecture. - Refactor cloudbuild.yaml to use docker buildx with QEMU emulation and direct manifest-list pushing. - Remove hardcoded amd64 platform constraints from docker-compose.yml. - Update README.md to document arm64 capabilities and simplify local commands. fixes: flutter/flutter#188873
There was a problem hiding this comment.
Code Review
This pull request introduces multi-architecture support (linux/amd64 and linux/arm64) for the Flutter Docker environment by updating the Dockerfiles, README, docker-compose, and transitioning the Cloud Build pipeline to use Docker Buildx with QEMU. Feedback on these changes highlights critical issues in cloudbuild.yaml where using a static builder name across separate build steps will cause container name conflicts and build failures. Additionally, improvements are suggested to avoid unquoted variables for word-splitting in Dockerfile.base and to pin the yq binary to a specific version in Dockerfile to ensure deterministic builds.
|
/gemini review again. |
There was a problem hiding this comment.
Code Review
This pull request adds multi-architecture support (linux/amd64 and linux/arm64) to the Flutter Docker development environment. It updates the Dockerfiles to dynamically handle architecture-specific downloads and cache exclusions, refactors the Cloud Build pipeline to build multi-arch images using docker buildx, and updates the documentation and docker-compose configuration. Feedback is provided to improve the robustness of local builds in Dockerfile.base by falling back to dpkg --print-architecture if TARGETARCH is not set.
fixes: flutter/flutter#188873