28 lines
716 B
Docker
28 lines
716 B
Docker
FROM golang:alpine AS build
|
|
ARG GOARCH="amd64"
|
|
|
|
ARG SMTPRELAY_VERSION=1.10.0 \
|
|
SMTPRELAY_LISTEN=0.0.0.0:25
|
|
|
|
RUN set -eux &&\
|
|
apk --no-cache upgrade &&\
|
|
apk --no-cache add git libcap &&\
|
|
cd /tmp &&\
|
|
git clone --depth 1 --branch v${SMTPRELAY_VERSION} https://github.com/decke/smtprelay.git &&\
|
|
cd smtprelay &&\
|
|
go build -v -o smtprelay &&\
|
|
setcap cap_net_bind_service=+ep ./smtprelay &&\
|
|
chmod +x ./smtprelay
|
|
|
|
FROM danielberteaud/alpine
|
|
MAINTAINER Daniel Berteaud <dbd@ehtrace.com>
|
|
|
|
RUN set -eux &&\
|
|
apk --no-cache upgrade &&\
|
|
apk --no-cache add tini
|
|
|
|
COPY --from=build /tmp/smtprelay/smtprelay /usr/local/bin/
|
|
|
|
ENTRYPOINT ["tini", "--", "/entrypoint.sh"]
|
|
CMD ["smtprelay"]
|