Repository navigation
Document the target architecture of gateway image builds - #763
Open
CrowleyRajapakse wants to merge 1 commit into
Open
CrowleyRajapakse wants to merge 1 commit into
CrowleyRajapakse wants to merge 1 commit into
Conversation
The ap gateway image build reference listed five flags the command doesn't have, and described --platform as selecting the target platform. --platform applies only to the docker buildx step. The gateway builder compiles the Policy Engine binary for the architecture it runs on, so an ARM64 machine building for linux/amd64 produces an image whose runtime fails with "Exec format error". Remove the nonexistent flags, add a flags table, and add a Target architecture section covering DOCKER_DEFAULT_PLATFORM, the buildx push behaviour of --platform, single-platform builds, and how to check the compiled binary. Fix the flag list on the customizing gateway policies page to match. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
This branch has not been deployed
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.
Purpose
The
ap gateway image buildreference doesn't explain how the command chooses the architecture of the images it builds, and it lists flags the command doesn't have:--platformis described as the target platform, but it applies only to the finaldocker buildxstep. The gateway builder compiles the Policy Engine binary for the architecture it runs on. On an ARM64 machine, such as an Apple silicon Mac,--platform linux/amd64therefore produces alinux/amd64image with an ARM64policy-engine, and the gateway runtime fails to start withExec format error.--platformalways pushes, even without--push, and the images aren't loaded into local Docker. The pages don't say so.--version,--gateway-builder,--gateway-controller-base-image,--router-base-imageand--offlinearen't flags of the command inapv0.9.1 or onmain, so copying them fails withunknown flag. The base images are set inbuild.yaml.Goals
Document what each flag does, and how to build images for the build machine's architecture or for another one.
Approach
tools/cli/reference.md, section 11:--platformdoesn't change the Policy Engine binary;DOCKER_DEFAULT_PLATFORM;--platformrequires and does:docker buildx, an unconditional push, and one platform per run;--output-dirandfile.{ #target-architecture }ID. Withtoc_depth: 3, MkDocs doesn't generate IDs for H4 headings, so links to it would otherwise break.tools/cli/customizing-gateway-policies.md: fix the flag list (--namehas no-nshort flag,--pathhas-p, and--pushand--no-cachewere missing their dashes), and link--platformto the new section.Checklist
llms.txt(located aten/docs/llms.txt) is updated for AI readiness content. No change needed: its entries for both pages still describe them correctly.last_updatedis set to 2026-11-03 on both pages.Documentation
Related PRs
docs/cli).Test environment
mkdocs buildusingen/requirements.txt. Both pages render, and both links to#target-architectureresolve.cli/src/cmd/gateway/image/build.goandcli/src/internal/gateway/docker_build.go, which are identical inap/v0.9.1and onmain.DOCKER_DEFAULT_PLATFORM,--platform linux/amd64produced an ARM aarch64policy-engine.DOCKER_DEFAULT_PLATFORM=linux/amd64, the build produced an x86-64policy-engine, both with and without--platform. Without--platform, the images were in local Docker aslinux/amd64. The resulting runtime image started and served API requests.ghcr.io/wso2/api-platform, and for 1.2.0.19 onregistry.wso2.com, listlinux/amd64andlinux/arm64.🤖 Generated with Claude Code