sendmail/Dockerfile

24 lines
400 B
Docker
Raw Normal View History

FROM golang:1.13 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 gcr.io/distroless/static
ENV sm_server ""
ENV sm_port "465"
ENV sm_user ""
ENV sm_password ""
ENV sm_from ""
ENV sm_to ""
ENV sm_sub ""
COPY --from=builder /sendmail /
WORKDIR /
ENTRYPOINT ["/sendmail"]