2017-04-19 10:56:02 +02:00
|
|
|
FROM jedisct1/alpine-runit:latest
|
2015-07-06 01:39:54 +02:00
|
|
|
MAINTAINER Frank Denis
|
2019-08-05 17:44:31 +02:00
|
|
|
SHELL ["/bin/sh", "-x", "-c"]
|
2019-06-10 12:26:26 +02:00
|
|
|
ENV SERIAL 3
|
2015-07-06 01:39:54 +02:00
|
|
|
|
2019-03-23 17:21:41 +01:00
|
|
|
ENV BUILD_DEPS make gcc musl-dev git libevent-dev expat-dev shadow autoconf file openssl-dev byacc linux-headers
|
2019-03-10 18:41:18 +01:00
|
|
|
ENV RUNTIME_DEPS bash util-linux coreutils findutils grep openssl ldns ldns-tools libevent expat libexecinfo coreutils drill ca-certificates
|
2015-07-06 01:39:54 +02:00
|
|
|
|
2019-08-05 17:44:31 +02:00
|
|
|
RUN apk --no-cache upgrade && apk add --no-cache $RUNTIME_DEPS && \
|
2019-03-10 18:41:18 +01:00
|
|
|
update-ca-certificates 2> /dev/null || true
|
2015-07-06 01:39:54 +02:00
|
|
|
|
2019-02-05 18:12:37 +01:00
|
|
|
ENV UNBOUND_GIT_URL https://github.com/jedisct1/unbound.git
|
2019-06-29 17:39:59 +02:00
|
|
|
ENV UNBOUND_GIT_REVISION 4edb15ba417c78710069a5be8be3a6b5d8bdba9c
|
2015-07-06 01:39:54 +02:00
|
|
|
|
2019-08-05 17:56:18 +02:00
|
|
|
WORKDIR /tmp
|
|
|
|
|
2019-08-05 17:44:31 +02:00
|
|
|
RUN apk add --no-cache $BUILD_DEPS && \
|
2019-05-03 17:17:10 +02:00
|
|
|
git clone --depth=1000 "$UNBOUND_GIT_URL" && \
|
2019-02-05 18:12:37 +01:00
|
|
|
cd unbound && \
|
2019-02-05 18:50:10 +01:00
|
|
|
git checkout "$UNBOUND_GIT_REVISION" && \
|
2015-07-06 01:39:54 +02:00
|
|
|
groupadd _unbound && \
|
|
|
|
useradd -g _unbound -s /etc -d /dev/null _unbound && \
|
2017-04-19 10:56:02 +02:00
|
|
|
./configure --prefix=/opt/unbound --with-pthreads \
|
2018-01-22 15:52:52 +01:00
|
|
|
--with-username=_unbound --with-libevent --enable-event-api && \
|
2019-08-05 17:38:12 +02:00
|
|
|
make -j"$(getconf _NPROCESSORS_ONLN)" install && \
|
2015-07-06 01:39:54 +02:00
|
|
|
mv /opt/unbound/etc/unbound/unbound.conf /opt/unbound/etc/unbound/unbound.conf.example && \
|
2019-05-03 17:43:10 +02:00
|
|
|
apk del --purge $BUILD_DEPS && \
|
2015-07-06 01:39:54 +02:00
|
|
|
rm -fr /opt/unbound/share/man && \
|
|
|
|
rm -fr /tmp/* /var/tmp/*
|
|
|
|
|
2019-03-10 18:41:18 +01:00
|
|
|
ENV LIBSODIUM_GIT_URL https://github.com/jedisct1/libsodium.git
|
2015-07-06 01:39:54 +02:00
|
|
|
|
2019-08-05 17:44:31 +02:00
|
|
|
RUN apk add --no-cache $BUILD_DEPS && \
|
2019-05-03 17:17:10 +02:00
|
|
|
git clone --depth=1 --branch stable "$LIBSODIUM_GIT_URL" && \
|
2019-03-10 18:41:18 +01:00
|
|
|
cd libsodium && \
|
2017-04-19 10:56:02 +02:00
|
|
|
env CFLAGS=-Ofast ./configure --disable-dependency-tracking && \
|
2019-08-05 17:38:12 +02:00
|
|
|
make -j"$(getconf _NPROCESSORS_ONLN)" check && make -j"$(getconf _NPROCESSORS_ONLN)" install && \
|
2017-04-19 10:56:02 +02:00
|
|
|
ldconfig /usr/local/lib && \
|
2019-05-03 17:43:10 +02:00
|
|
|
apk del --purge $BUILD_DEPS && \
|
2017-04-19 10:56:02 +02:00
|
|
|
rm -fr /tmp/* /var/tmp/*
|
2015-07-06 01:39:54 +02:00
|
|
|
|
2017-06-20 17:19:45 +02:00
|
|
|
ENV DNSCRYPT_WRAPPER_GIT_URL https://github.com/jedisct1/dnscrypt-wrapper.git
|
2018-01-22 20:23:54 +01:00
|
|
|
ENV DNSCRYPT_WRAPPER_GIT_BRANCH xchacha-stamps
|
2015-07-06 01:39:54 +02:00
|
|
|
|
2017-04-19 10:56:02 +02:00
|
|
|
COPY queue.h /tmp
|
|
|
|
|
2019-08-05 17:44:31 +02:00
|
|
|
RUN apk add --no-cache $BUILD_DEPS && \
|
2019-08-05 17:38:12 +02:00
|
|
|
git clone --depth=1 --branch="${DNSCRYPT_WRAPPER_GIT_BRANCH}" "${DNSCRYPT_WRAPPER_GIT_URL}" && \
|
2017-06-20 17:19:45 +02:00
|
|
|
cd dnscrypt-wrapper && \
|
2017-04-19 10:56:02 +02:00
|
|
|
sed -i 's#<sys/queue.h>#"/tmp/queue.h"#' compat.h && \
|
|
|
|
sed -i 's#HAVE_BACKTRACE#NO_BACKTRACE#' compat.h && \
|
2015-07-06 01:39:54 +02:00
|
|
|
mkdir -p /opt/dnscrypt-wrapper/empty && \
|
|
|
|
groupadd _dnscrypt-wrapper && \
|
|
|
|
useradd -g _dnscrypt-wrapper -s /etc -d /opt/dnscrypt-wrapper/empty _dnscrypt-wrapper && \
|
|
|
|
groupadd _dnscrypt-signer && \
|
|
|
|
useradd -g _dnscrypt-signer -G _dnscrypt-wrapper -s /etc -d /dev/null _dnscrypt-signer && \
|
2019-08-05 17:38:12 +02:00
|
|
|
make -j"$(getconf _NPROCESSORS_ONLN)" configure && \
|
2017-06-20 19:56:15 +02:00
|
|
|
env CFLAGS=-Ofast ./configure --prefix=/opt/dnscrypt-wrapper && \
|
2019-08-05 17:38:12 +02:00
|
|
|
make -j"$(getconf _NPROCESSORS_ONLN)" install && \
|
2019-05-03 17:43:10 +02:00
|
|
|
apk del --purge $BUILD_DEPS && \
|
2015-07-06 01:39:54 +02:00
|
|
|
rm -fr /tmp/* /var/tmp/*
|
|
|
|
|
|
|
|
RUN mkdir -p \
|
|
|
|
/etc/service/unbound \
|
|
|
|
/etc/service/watchdog
|
|
|
|
|
2015-07-08 00:19:02 +02:00
|
|
|
COPY entrypoint.sh /
|
2015-07-06 01:39:54 +02:00
|
|
|
|
2015-07-08 00:19:02 +02:00
|
|
|
COPY unbound.sh /etc/service/unbound/run
|
|
|
|
COPY unbound-check.sh /etc/service/unbound/check
|
2015-07-06 01:39:54 +02:00
|
|
|
|
2015-07-08 00:19:02 +02:00
|
|
|
COPY dnscrypt-wrapper.sh /etc/service/dnscrypt-wrapper/run
|
2015-07-06 01:39:54 +02:00
|
|
|
|
2015-07-08 00:19:02 +02:00
|
|
|
COPY key-rotation.sh /etc/service/key-rotation/run
|
|
|
|
COPY watchdog.sh /etc/service/watchdog/run
|
2015-07-06 01:39:54 +02:00
|
|
|
|
|
|
|
VOLUME ["/opt/dnscrypt-wrapper/etc/keys"]
|
|
|
|
|
2015-11-28 13:52:35 +01:00
|
|
|
EXPOSE 443/udp 443/tcp
|
2015-07-06 01:39:54 +02:00
|
|
|
|
2017-04-19 10:56:02 +02:00
|
|
|
CMD ["/sbin/start_runit"]
|
2015-07-06 01:39:54 +02:00
|
|
|
|
|
|
|
ENTRYPOINT ["/entrypoint.sh"]
|