Lauri Võsandi
5e64dfa04a
All checks were successful
continuous-integration/drone/push Build is passing
22 lines
520 B
Docker
22 lines
520 B
Docker
FROM golang:1.21-alpine as build
|
|
RUN apk add ca-certificates
|
|
|
|
WORKDIR /godoor
|
|
|
|
# pre-copy/cache go.mod for pre-downloading dependencies and only redownloading them in subsequent builds if they change
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download && go mod verify
|
|
|
|
|
|
COPY . .
|
|
|
|
ENV GOBUILDLDFLAGS="-linkmode 'external' -extldflags '-static'"
|
|
RUN go build -tags netgo .
|
|
|
|
FROM scratch
|
|
WORKDIR /
|
|
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
|
COPY --from=build /godoor/godoor /godoor
|
|
|
|
ENTRYPOINT ["/godoor"]
|