Skip to content

Commit

Permalink
Switch condition for setting docker platform
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandros Sapranidis <alexandros@elastic.co>
  • Loading branch information
alexsapran committed Apr 23, 2024
1 parent 708a5ef commit 08910e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dev-tools/mage/crossbuild.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ func (b GolangCrossBuilder) Build() error {
// This fixes an issue where during arm64 linux build for the currently used docker image
// docker.elastic.co/beats-dev/golang-crossbuild:1.21.9-arm the image for amd64 arch is pulled
// and causes problems when using native arch tools on the binaries that are built for arm64 arch.
if strings.HasPrefix(b.Platform, "linux/") && strings.Contains(b.Platform, "arm64") {
if runtime.GOOS == "linux" && runtime.GOARCH == "arm64" {
args = append(args,
"--platform", b.Platform,
)
Expand Down

0 comments on commit 08910e9

Please sign in to comment.