sendmail/Dockerfile
2020-04-29 10:13:02 +02:00

19 lines
401 B
Docker

FROM golang:1.14 AS builder
WORKDIR /app
COPY go.mod go.sum /app/
RUN go mod download
COPY *go /app/
RUN GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -tags netgo -o /sendmail ./...
FROM busybox:latest AS shell
FROM gcr.io/distroless/static
WORKDIR /
COPY --from=builder /sendmail /
COPY --from=shell /bin/cat /bin/date /bin/sh /bin/
COPY sendmail.sh /sendmail.sh
ENTRYPOINT ["/sendmail.sh"]