-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.static-windows
33 lines (27 loc) · 1.18 KB
/
Dockerfile.static-windows
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
FROM ghcr.io/darkness4/fc2-live-dl-go:latest-static-windows-base AS builder
WORKDIR /work
COPY go.mod go.sum ./
RUN go mod download
COPY . .
ARG TARGETARCH
ARG VERSION=dev
RUN if [ "${TARGETARCH}" = "amd64" ]; then \
export CC="x86_64-w64-mingw32.static-gcc"; \
export CXX="x86_64-w64-mingw32.static-g++"; \
export PKG_CONFIG="x86_64-w64-mingw32.static-pkg-config"; \
export AR="x86_64-w64-mingw32.static-ar"; \
export NM="x86_64-w64-mingw32.static-nm"; \
export RANLIB="x86_64-w64-mingw32.static-ranlib"; \
elif [ "${TARGETARCH}" = "arm64" ]; then \
export CC="aarch64-w64-mingw32.static-gcc"; \
export CXX="aarch64-w64-mingw32.static-g++"; \
export PKG_CONFIG="aarch64-w64-mingw32.static-pkg-config"; \
export AR="aarch64-w64-mingw32.static-ar"; \
export NM="aarch64-w64-mingw32.static-nm"; \
export RANLIB="aarch64-w64-mingw32.static-ranlib"; \
fi; \
GOARCH=${TARGETARCH} make bin/fc2-live-dl-go-static.exe VERSION=${VERSION}
# Helper container to copy binaries outside the container using podman/buildx export. Unused in production.
FROM scratch AS export
ARG TARGETARCH
COPY --from=builder /work/bin/fc2-live-dl-go-static.exe /fc2-live-dl-go-windows-${TARGETARCH}.exe