targetarch from buildx

This commit is contained in:
pat-s 2024-04-29 00:11:26 +02:00
parent 3cd40defd6
commit c4c87cf428
No known key found for this signature in database
GPG key ID: 3C6318841EF78925

View file

@ -15,7 +15,7 @@ ARG TARGETOS TARGETARCH
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg \
GOOS=${TARGETOS} GOARCH=${TARGETARCH} CGO_ENABLED=1 \
xgo -x -v --targets=linux/arm64,linux/amd64 -tags='sqlite sqlite_unlock_notify netgo' -ldflags='-s -w -extldflags "-static" -linkmode external' -out pages .
xgo -x -v --targets=${TARGETOS}/${TARGETARCH} -tags='sqlite sqlite_unlock_notify netgo' -ldflags='-s -w -extldflags "-static" -linkmode external' -out pages .
# Use a scratch image as the base image for the final container,
# which will contain only the built binary and the CA certificates