FROM alpine:3.14 COPY sources/* /opt/OpenDKIM-Docker/ COPY opendkim.conf /etc/opendkim/opendkim.conf ADD syscid-ca.crt /usr/local/share/ca-certificates/syscid.crt RUN apk add --no-cache \ alpine-sdk \ ca-certificates \ curl \ automake \ autoconf \ db-dev \ libtool \ mariadb-dev \ readline-dev \ gettext \ && cd /opt/OpenDKIM-Docker \ && tar xzf opendbx-1.4.6.tar.gz \ && cd opendbx-1.4.6/ \ && CPPFLAGS="-I/usr/include/mysql" ./configure --with-backends="mysql" \ && make -j4 \ && make install RUN apk add --no-cache \ openssl-dev \ libmilter-dev \ && cd /opt/OpenDKIM-Docker/ \ && tar xzf 2.11.0-Beta2.tar.gz \ && cd OpenDKIM-2.11.0-Beta2 \ && autoreconf -vif \ && CPPFLAGS="-I/usr/include/openssl" ./configure \ --sysconfdir=/etc/opendkim \ --with-odbx \ --with-openssl \ --with-sql-backend \ && make -j4 \ && make install RUN mkdir /run/opendkim \ mkdir /var/lib/opendkim \ && addgroup -S opendkim && adduser -S opendkim -h /var/lib/opendkim -G opendkim \ && chown opendkim:opendkim /run/opendkim \ && chown opendkim:opendkim /var/lib/opendkim \ && chown opendkim:opendkim /etc/opendkim RUN update-ca-certificates EXPOSE 8960 ENTRYPOINT ["/usr/local/sbin/opendkim"] CMD ["-f", "-v", "-x", "/etc/opendkim/opendkim.conf"]