Install the git-gate gitleaks binary for the build's target arch #408
Reference in New Issue
Block a user
Delete Branch "fix-gateway-gitleaks-arch"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #407.
Summary
Dockerfile.gatewayhardcoded the x86_64 gitleaks download (gitleaks_${GITLEAKS_VERSION}_linux_x64.tar.gz), so a gateway image built on/for aarch64 baked in an x86_64 binary. It sat quiet until the git-gate pre-receive hook first ran it, where the kernel refused the foreign-arch exec (gitleaks: Exec format error), failing every push through that gateway.Now the asset + pinned SHA256 are picked from the build's target architecture:
TARGETARCH(auto-populated by BuildKit), falling back todpkg --print-architectureunder a legacy builderVerification
The existing integration test
test_gateway_image.py::test_gitleaks_binary_present_and_versionedexecsgitleaks versionin the built image, so it now passes on arm64 instead of hitting the same error. Confirmed end-to-end on an arm64 host: build resolvesTARGETARCH=arm64->linux_arm64, SHA checks OK, and/usr/bin/gitleaks version->8.30.1.