2 Commits

Author SHA1 Message Date
Vladislav Yarmak
3660a85422 more trimpath for reproducibility 2023-10-08 14:44:39 +03:00
Vladislav Yarmak
f82a25c45e docker: cross-compile 2023-10-08 14:11:11 +03:00
2 changed files with 4 additions and 3 deletions

View File

@@ -1,10 +1,11 @@
FROM golang AS build
FROM --platform=$BUILDPLATFORM golang AS build
ARG GIT_DESC=undefined
WORKDIR /go/src/github.com/Snawoot/windscribe-proxy
COPY . .
RUN CGO_ENABLED=0 go build -a -tags netgo -ldflags '-s -w -extldflags "-static" -X main.version='"$GIT_DESC"
ARG TARGETOS TARGETARCH
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
RUN chmod 0644 /certs.crt
RUN mkdir /state

View File

@@ -1,7 +1,7 @@
PROGNAME = windscribe-proxy
OUTSUFFIX = bin/$(PROGNAME)
VERSION := $(shell git describe)
BUILDOPTS = -a -tags netgo -trimpath
BUILDOPTS = -a -tags netgo -trimpath -asmflags -trimpath
LDFLAGS = -ldflags '-s -w -extldflags "-static" -X main.version=$(VERSION)'
LDFLAGS_NATIVE = -ldflags '-s -w -X main.version=$(VERSION)'