docker: crosscompile

This commit is contained in:
Vladislav Yarmak 2023-09-30 15:34:16 +03:00
parent 1a91d8756c
commit 28cd813886
1 changed files with 2 additions and 2 deletions

View File

@ -1,10 +1,10 @@
FROM golang AS build FROM --platform=$BUILDPLATFORM golang AS build
ARG GIT_DESC=undefined ARG GIT_DESC=undefined
WORKDIR /go/src/github.com/Snawoot/dumbproxy WORKDIR /go/src/github.com/Snawoot/dumbproxy
COPY . . COPY . .
RUN CGO_ENABLED=0 go build -a -tags netgo -ldflags '-s -w -extldflags "-static" -X main.version='"$GIT_DESC" RUN GOOS=$TARGETOS GOARCH=$TARGETARCH CGO_ENABLED=0 go build -a -tags netgo -ldflags '-s -w -extldflags "-static" -X main.version='"$GIT_DESC"
ADD https://curl.haxx.se/ca/cacert.pem /certs.crt ADD https://curl.haxx.se/ca/cacert.pem /certs.crt
RUN chmod 0644 /certs.crt RUN chmod 0644 /certs.crt
RUN mkdir /.dumbproxy RUN mkdir /.dumbproxy