Skip to content

Commit

Permalink
Remove hardcoded GOOS and GOARCH env vars (#154)
Browse files Browse the repository at this point in the history
Otherwise it'll always (cross) compile for linux/amd64 regardless of the current arch.

Ref. #143 (comment)
  • Loading branch information
maxcanna authored Nov 28, 2021
1 parent 3ff0942 commit 451c0d4
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions Dockerfile-prod
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ FROM golang:1.16-alpine AS builder
RUN apk update && apk upgrade && \
apk add --no-cache bash git openssh gcc libc-dev
ENV GOPATH /app
ENV GOOS linux
ENV GOARCH arm64

RUN mkdir -p /app/src/github.com/darkweak/cmd
RUN mkdir -p /app/src/github.com/darkweak/souin
Expand All @@ -24,7 +22,7 @@ ADD ./plugins /app/src/github.com/darkweak/souin/plugins
WORKDIR /app/src/github.com/darkweak/souin
RUN go mod download

RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a \
RUN CGO_ENABLED=0 go build -a \
-tags netgo -ldflags '-w -extldflags "-static"' -o /app/cmd/souin ./plugins/souin

EXPOSE 80
Expand Down

0 comments on commit 451c0d4

Please sign in to comment.