Add TARGETOS and TARGETARCH to fix multi-platform compilation issue.
This commit is contained in:
parent
014a5e85a2
commit
b8ea94bb61
1 changed files with 2 additions and 0 deletions
|
@ -11,6 +11,8 @@ RUN go mod download
|
||||||
COPY . .
|
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/
|
||||||
|
ARG TARGETOS TARGETARCH
|
||||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} go build -o opendtu-logger .
|
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} go build -o opendtu-logger .
|
||||||
|
|
||||||
# Create a minimal runtime image
|
# Create a minimal runtime image
|
||||||
|
|
Loading…
Reference in a new issue