Make go build TARGETOS configurable.
This commit is contained in:
parent
b8ea94bb61
commit
76dbd9e418
1 changed files with 1 additions and 1 deletions
|
@ -13,7 +13,7 @@ COPY . .
|
||||||
# Build the application for the specified target architecture
|
# Build the application for the specified target architecture
|
||||||
# https://www.docker.com/blog/faster-multi-platform-builds-dockerfile-cross-compilation-guide/
|
# https://www.docker.com/blog/faster-multi-platform-builds-dockerfile-cross-compilation-guide/
|
||||||
ARG TARGETOS TARGETARCH
|
ARG TARGETOS TARGETARCH
|
||||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} go build -o opendtu-logger .
|
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o opendtu-logger .
|
||||||
|
|
||||||
# Create a minimal runtime image
|
# Create a minimal runtime image
|
||||||
FROM --platform=${TARGETPLATFORM} scratch
|
FROM --platform=${TARGETPLATFORM} scratch
|
||||||
|
|
Loading…
Reference in a new issue