mirror of
https://github.com/datarhei/core.git
synced 2025-12-24 13:07:56 +08:00
Use cross-compilation instead of emulation
This commit is contained in:
@@ -1,8 +1,12 @@
|
||||
ARG GOLANG_IMAGE=golang:1.20-alpine3.16
|
||||
|
||||
ARG BUILD_IMAGE=alpine:3.16
|
||||
|
||||
FROM $GOLANG_IMAGE as builder
|
||||
# Cross-Compilation
|
||||
# https://www.docker.com/blog/faster-multi-platform-builds-dockerfile-cross-compilation-guide/
|
||||
FROM --platform=$BUILDPLATFORM $GOLANG_IMAGE as builder
|
||||
|
||||
ARG TARGETOS TARGETARCH
|
||||
ENV GOOS=$TARGETOS GOARCH=$TARGETARCH
|
||||
|
||||
COPY . /dist/core
|
||||
|
||||
|
||||
Reference in New Issue
Block a user