-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
45 lines (30 loc) · 1.09 KB
/
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
37
38
39
40
41
42
43
44
45
FROM alpine:3.20 AS build
ARG commit=12ef94af66c2437f2d317
RUN \
apk --no-cache add curl tar gcc libc-dev autoconf automake libtool make openssl-dev libmilter-dev unbound-dev && \
mkdir /opendkim && \
curl -sL https://github.com/andreasschulze/OpenDKIM/archive/$commit.tar.gz | \
tar xzf - -C /opendkim --strip-components=1
WORKDIR /opendkim
RUN autoreconf -vif
RUN ./configure \
--with-unbound \
--prefix=/usr \
--sysconfdir=/etc/opendkim
RUN make
RUN make install-strip
FROM alpine:3.20
LABEL maintainer="Richard Kojedzinszky <richard@kojedz.in>"
RUN \
addgroup -g 10024 opendkim && \
adduser -h /run/opendkim -S -D -H -G opendkim -u 10024 opendkim && \
apk --no-cache add libssl3 libmilter unbound-libs dnssec-root && \
mkdir /etc/opendkim-private && \
chown opendkim /etc/opendkim-private && \
chmod 750 /etc/opendkim-private
COPY --from=build /usr/sbin/opendkim /usr/sbin/opendkim
COPY --from=build /usr/lib/libopendkim.so.11.0.0 /usr/lib/libopendkim.so.11
COPY assets/ /
USER 10024
RUN /usr/sbin/opendkim -V
CMD ["/usr/local/sbin/opendkim.sh"]