fix: Use docker image to build binary for different platforms #9657
+24
−2
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.
Fixes: #nnn
Related: Relevant tracking issues, for context
Merge before/after: Dependent or prerequisite PRs
Description
An update to one of the skaffold dependencies introduced a new dependency on the runtime/cgo package, breaking the ability to built skafofld binaries for different platforms with the existing logic.
Although the official golang docker images allow cross-compilation, it doesn't work when cgo is enabled. Although installing the platform-specific is possible with the golang image, I instead opted to use images from the elastic/crossbuild project which maintain docker images specifically designed for cross-compilation.
User facing changes (remove if N/A)
A new depedency on docker when building the skaffold binary for different platforms.
Test
The cross-compilation was tested with a github action running on mac here: #9658
Follow-up Work (remove if N/A)