forked from grafana/smtprelay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
36 lines (25 loc) · 1018 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
FROM golang:1.23-alpine as build
RUN apk add --no-cache ca-certificates make git
WORKDIR /go/src/github.com/grafana/smtprelay
ARG TARGETOS
ARG TARGETARCH
ARG TARGETVARIANT
ENV GOOS=${TARGETOS} GOARCH=${TARGETARCH} GOARM=${TARGETVARIANT}
ENV CGO_ENABLED=0
COPY go.mod go.sum ./
RUN go mod download -x
COPY . ./
RUN make build
# sanity check - make sure the binary runs and is executable
RUN bin/smtprelay --version
FROM alpine:3.20 AS runtime
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=build /go/src/github.com/grafana/smtprelay/bin/smtprelay /usr/local/bin/smtprelay
ARG GIT_REVISION
LABEL org.opencontainers.image.revision=$GIT_REVISION \
org.opencontainers.image.vendor="Grafana Labs" \
org.opencontainers.image.title="smtprelay" \
org.opencontainers.image.source="https://github.com/grafana/smtprelay"
# users need to mount config file at /usr/local/smtprelay.ini
ENTRYPOINT [ "/usr/local/bin/smtprelay" ]
CMD [ "--help" ]