Skip to content

Fixed docker builds for ARM#1478

Merged
fedepaol merged 2 commits intometallb:mainfrom
jtcarnes:fix-docker-build
Jul 6, 2022
Merged

Fixed docker builds for ARM#1478
fedepaol merged 2 commits intometallb:mainfrom
jtcarnes:fix-docker-build

Conversation

@jtcarnes
Copy link
Contributor

@jtcarnes jtcarnes commented Jul 6, 2022

Fixes issue where binaries were always compiled against GOARM 6, which caused issues for ARM users
(who primarily use arm7). Added a set in container build to map to the correct variant.

I've tested locally and they do appear to work, happy to have someone else test it though.

docker buildx build --platform linux/arm/v7 -t testing:armv7 --load -f controller/Dockerfile .

docker run --rm testing:armv7

{ ..., {"goversion":"gc / go1.18.3 / arm"}, ...}

The command commands build the image, load it locally and when run it'll fail (not in a cluster) but it will show you the architecture it's built for which should be correct.

Fixes #1476

@jtcarnes jtcarnes force-pushed the fix-docker-build branch from f96ae33 to b95fa62 Compare July 6, 2022 18:04
ARM variants of images were being built with GOARM=6, which was causing
issues for users. Added a step in the container builds that maps
target platform to variant to ensure they are compiled against the right
architecture.

Signed-off-by: Joshua Carnes <56089764+jtcarnes@users.noreply.github.com>
@jtcarnes jtcarnes force-pushed the fix-docker-build branch from b95fa62 to 6109c3a Compare July 6, 2022 18:12
@gclawes
Copy link
Contributor

gclawes commented Jul 6, 2022

Good detective work! @fedepaol and I were talking in slack, but I didn't catch the GOARM variable, I thought it was building x86_64 binaries somehow in linux/arm64 containers.

@fedepaol
Copy link
Member

fedepaol commented Jul 6, 2022

Testing this and #1479 together in my private repo with https://github.com/fedepaol/metallb/runs/7220821358?check_suite_focus=true

@fedepaol fedepaol merged commit 683fd40 into metallb:main Jul 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0.13.2: multi-arch images broken

3 participants