sendmail/Dockerfile

20 lines
444 B
Docker
Raw Normal View History

2020-04-29 09:49:24 +02:00
FROM golang:1.14 AS builder
ARG version=dev
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 -X main.version=${version}" -tags netgo -o /sendmail ./...
2020-04-29 09:49:24 +02:00
FROM busybox:latest AS shell
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-04-29 09:49:24 +02:00
ENTRYPOINT ["/sendmail.sh"]