Skip to content

Commit

Permalink
Merge pull request #38 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 3d216e5 + fd23627 commit f03aabb
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 AS build
FROM --platform=$BUILDPLATFORM golang AS build

ARG GIT_DESC=undefined

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

Please sign in to comment.