Skip to content

Commit

Permalink
Merge pull request #102 from Snawoot/docker-crosscompile
Browse files Browse the repository at this point in the history
docker: crosscompile
  • Loading branch information
Snawoot authored Sep 30, 2023
2 parents ba18da6 + 77bfe79 commit 39a9ba0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
FROM golang:1.21 AS build
FROM --platform=$BUILDPLATFORM golang:1.21 AS build

ARG GIT_DESC=undefined

WORKDIR /go/src/github.com/Snawoot/hola-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

Expand Down

0 comments on commit 39a9ba0

Please sign in to comment.