onasty/mailer.Dockerfile (view raw)
| 1 | FROM onasty:builder AS builder |
| 2 | |
| 3 | COPY internal internal |
| 4 | COPY mailer mailer |
| 5 | |
| 6 | ENV CGO_ENABLED=0 GOOS=linux GOARCH=amd64 |
| 7 | RUN --mount=type=cache,target=/root/.cache/go-build,id=onasty-go-build \ |
| 8 | --mount=type=cache,target=/go/pkg/mod,id=onasty-go-mod \ |
| 9 | go build -trimpath -ldflags='-w -s' -o /mailer ./mailer |
| 10 | |
| 11 | FROM onasty:runtime |
| 12 | COPY --from=builder /mailer /mailer |
| 13 | ENTRYPOINT ["/mailer"] |