2020-07-19 12:02:08 +02:00
|
|
|
FROM golang:1.14 AS builder
|
2019-12-14 07:33:24 +01:00
|
|
|
COPY . /app
|
|
|
|
WORKDIR /app
|
|
|
|
RUN go generate
|
|
|
|
RUN \
|
|
|
|
CGO_ENABLED=0 \
|
|
|
|
GOOS=linux \
|
|
|
|
GOPROXY=https://proxy.golang.org,direct \
|
|
|
|
go build -o main main.go
|
|
|
|
|
|
|
|
FROM scratch
|
|
|
|
COPY contrib/etc_group /etc/group
|
|
|
|
COPY contrib/etc_passwd /etc/passwd
|
|
|
|
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
|
|
|
COPY --from=builder /app/main /main
|
|
|
|
USER user
|
|
|
|
ENTRYPOINT ["/main"]
|
|
|
|
CMD ["server"]
|