Get Dockerfile env vars properly working: #75
Merged
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.
Description
The
TARGETARCH
andTARGETOS
env vars weren't making it to thego build
command so theGOOS
andGOARCH
were would be empty and the build would only use amd64.Why is this needed
Manually tested by running this locally:
docker buildx build --cache-from type=registry,ref=quay.io/tinkerbell/rufio:latest --file ./Dockerfile --load -t rufio:test --platform linux/arm64 ./
and then extracting the
manager
binary and validate the binary type to beARM aarch64
.Also, locally in the build logs you see
[builder 7/7] RUN CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -a -o manager main.go
versus in the GitHub actions log you see[linux/amd64 builder 7/7] RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -a -o manager main.go
https://github.com/tinkerbell/rufio/actions/runs/3831046658/jobs/6519718105#step:6:269
Fixes: #74
How Has This Been Tested?
How are existing users impacted? What migration steps/scripts do we need?
Checklist:
I have: