diff --git a/Dockerfile b/Dockerfile index 0614faef..f03e29bc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,7 +32,7 @@ RUN if [ "${TARGETARCH}" = "arm64" ] && [ "${BUILDARCH}" != "arm64" ]; then \ elif [ "${TARGETARCH}" = "amd64" ] && [ "${BUILDARCH}" != "amd64" ]; then \ export CC=x86_64-linux-musl-gcc CXX=x86_64-linux-musl-g++; \ fi; \ - GOOS=linux GOARCH=$TARGETARCH CGO_ENABLED=1 LDFLAGS='-linkmode external -extldflags "-static"'; \ + export GOOS=linux GOARCH=$TARGETARCH CGO_ENABLED=1 LDFLAGS='-linkmode external -extldflags "-static"'; \ go build -ldflags "-X github.com/strangelove-ventures/cosmos-operator/internal/version.version=$VERSION $LDFLAGS" -a -o manager . # Build final image from scratch diff --git a/local.Dockerfile b/local.Dockerfile index e9372dc2..0ef37e31 100644 --- a/local.Dockerfile +++ b/local.Dockerfile @@ -18,7 +18,7 @@ COPY internal/ internal/ ARG VERSION -RUN CGO_ENABLED=1 LDFLAGS='-linkmode external -extldflags "-static"'; \ +RUN export CGO_ENABLED=1 LDFLAGS='-linkmode external -extldflags "-static"'; \ go build -ldflags "-X github.com/strangelove-ventures/cosmos-operator/internal/version.version=$VERSION $LDFLAGS" -a -o manager . # Build final image from scratch