Skip to content

Commit 527ed09

Browse files
fix: switch Dockerfile of serverless image to trixie because golang-crossbuild isn't compatible with buildx multiplatforms (#5455) (#5463)
(cherry picked from commit a7e0e73) Co-authored-by: Panos Koutsovasilis <[email protected]>
1 parent 00617dc commit 527ed09

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
ARG GO_VERSION
2-
ARG SUFFIX
3-
FROM --platform=${BUILDPLATFORM:-linux} docker.elastic.co/beats-dev/golang-crossbuild:${GO_VERSION}-${SUFFIX} AS builder
2+
FROM --platform=${BUILDPLATFORM:-linux} golang:${GO_VERSION}-trixie AS builder
43

54
WORKDIR /fleet-server
65

magefile.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,9 +1051,17 @@ func (Docker) Publish() error {
10511051
if v, ok := os.LookupEnv(envDockerTag); ok && v != "" {
10521052
version = v
10531053
}
1054+
suffix := dockerSuffix
1055+
if runtime.GOARCH == "arm64" {
1056+
suffix = dockerArmSuffix
1057+
}
10541058
if isFIPS() {
10551059
dockerFile = dockerBuilderFIPS
10561060
image += "-fips"
1061+
suffix += "-fips"
1062+
}
1063+
if v, ok := os.LookupEnv(envDockerImage); ok && v != "" {
1064+
image = v
10571065
}
10581066
if v, ok := os.LookupEnv(envDockerImage); ok && v != "" {
10591067
image = v
@@ -1072,6 +1080,7 @@ func (Docker) Publish() error {
10721080
"--build-arg", "VERSION="+getVersion(),
10731081
"--build-arg", "GCFLAGS="+getGCFlags(),
10741082
"--build-arg", "LDFLAGS="+getLDFlags(),
1083+
"--build-arg", "SUFFIX="+suffix,
10751084
"-f", dockerFile,
10761085
"-t", image+":"+version,
10771086
".",

0 commit comments

Comments
 (0)