godoor/Dockerfile
Lauri Võsandi c6bacca63d
All checks were successful
ci/woodpecker/push/build/1 Pipeline was successful
ci/woodpecker/push/build/2 Pipeline was successful
ci/woodpecker/push/manifest Pipeline was successful
Use mirror.gcr.io
2024-08-15 22:54:09 +03:00

22 lines
542 B
Docker

FROM mirror.gcr.io/library/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"]