2020-04-29 09:49:24 +02:00
|
|
|
FROM golang:1.14 AS builder
|
2020-05-05 10:25:47 +02:00
|
|
|
ARG version=dev
|
2020-02-21 18:17:20 +01:00
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
COPY go.mod go.sum /app/
|
|
|
|
RUN go mod download
|
|
|
|
COPY *go /app/
|
2020-05-05 10:25:47 +02:00
|
|
|
RUN GOOS=linux GOARCH=amd64 go build -ldflags="-w -s -X main.version=${version}" -tags netgo -o /sendmail ./...
|
2020-02-21 18:17:20 +01:00
|
|
|
|
2020-04-29 09:49:24 +02:00
|
|
|
FROM busybox:latest AS shell
|
2020-02-21 18:17:20 +01:00
|
|
|
|
|
|
|
FROM gcr.io/distroless/static
|
|
|
|
|
|
|
|
WORKDIR /
|
2020-04-29 09:49:24 +02:00
|
|
|
COPY --from=builder /sendmail /
|
|
|
|
COPY --from=shell /bin/cat /bin/date /bin/sh /bin/
|
|
|
|
COPY sendmail.sh /sendmail.sh
|
2020-02-21 18:17:20 +01:00
|
|
|
|
2020-04-29 09:49:24 +02:00
|
|
|
ENTRYPOINT ["/sendmail.sh"]
|