fix: make build-gateway-local error (#3302) #3312
Open
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.
Ⅰ. Describe what this PR did
修复了 make build-gateway-local 在 ARM64 架构下构建时仍然使用 AMD64 架构的问题。
问题背景:
解决方案:
在 tools/hack/build-istio-image.sh 中添加了 DOCKER_ARCHITECTURES 环境变量的设置逻辑,根据 TARGET_ARCH 动态设置正确的架构:
并将该变量传递给 Docker 构建流程。
Ⅱ. Does this pull request fix one issue?
Fixes #3302
Ⅲ. Why don't you add test cases (unit test/integration test)?
这是一个构建脚本修复,修改的是 Shell 脚本的环境变量设置逻辑。修复可以通过实际执行 make build-gateway-local 命令并验证生成的镜像架构来验证,不需要额外的单元测试或集成测试。
Ⅳ. Describe how to verify it
验证步骤:
TARGET_ARCH=arm64 make build-gateway-local
TARGET_ARCH=amd64 make build-gateway-local
docker inspect | grep Architecture
Ⅴ. Special notes for reviews
Ⅰ. Describe what this PR did
Fixed issue with make build-gateway-local still using AMD64 architecture when building under ARM64 architecture.
Problem background:
Solution:
Added setting logic for the DOCKER_ARCHITECTURES environment variable in tools/hack/build-istio-image.sh to dynamically set the correct architecture based on TARGET_ARCH:
and pass this variable to the Docker build process.
Ⅱ. Does this pull request fix one issue?
Fixes #3302
Ⅲ. Why don't you add test cases (unit test/integration test)?
This is a build script fix that modifies the environment variable setting logic of the shell script. The fix can be verified by actually executing the make build-gateway-local command and verifying the resulting image architecture, no additional unit tests or integration tests are required.
Ⅳ. Describe how to verify it
Verification steps:
TARGET_ARCH=arm64 make build-gateway-local
TARGET_ARCH=amd64 make build-gateway-local
docker inspect | grep Architecture
Ⅴ. Special notes for reviews