2017-04-19 08:56:02 +00:00
|
|
|
FROM jedisct1/alpine-runit:latest
|
2015-07-05 23:39:54 +00:00
|
|
|
MAINTAINER Frank Denis
|
|
|
|
ENV SERIAL 1
|
|
|
|
|
2017-04-19 08:56:02 +00:00
|
|
|
ENV BUILD_DEPS make gcc musl-dev git ldns-dev libevent-dev expat-dev shadow autoconf file libexecinfo-dev
|
2017-04-27 07:10:45 +00:00
|
|
|
ENV RUNTIME_DEPS bash util-linux coreutils findutils grep libressl ldns ldns-tools libevent expat libtool libexecinfo coreutils drill
|
2015-07-05 23:39:54 +00:00
|
|
|
|
|
|
|
RUN set -x && \
|
2017-04-19 08:56:02 +00:00
|
|
|
apk --update upgrade && apk add $RUNTIME_DEPS $BUILD_DEPS
|
2015-07-05 23:39:54 +00:00
|
|
|
|
2017-06-13 17:21:49 +00:00
|
|
|
ENV UNBOUND_VERSION 1.6.3
|
|
|
|
ENV UNBOUND_SHA256 4c7e655c1d0d2d133fdeb81bc1ab3aa5c155700f66c9f5fb53fa6a5c3ea9845f
|
2016-04-19 06:19:45 +00:00
|
|
|
ENV UNBOUND_DOWNLOAD_URL https://www.unbound.net/downloads/unbound-${UNBOUND_VERSION}.tar.gz
|
2015-07-05 23:39:54 +00:00
|
|
|
|
|
|
|
RUN set -x && \
|
|
|
|
mkdir -p /tmp/src && \
|
|
|
|
cd /tmp/src && \
|
2017-04-19 08:56:02 +00:00
|
|
|
wget -O unbound.tar.gz $UNBOUND_DOWNLOAD_URL && \
|
2015-07-05 23:39:54 +00:00
|
|
|
echo "${UNBOUND_SHA256} *unbound.tar.gz" | sha256sum -c - && \
|
|
|
|
tar xzf unbound.tar.gz && \
|
|
|
|
rm -f unbound.tar.gz && \
|
|
|
|
cd unbound-${UNBOUND_VERSION} && \
|
|
|
|
groupadd _unbound && \
|
|
|
|
useradd -g _unbound -s /etc -d /dev/null _unbound && \
|
2017-04-19 08:56:02 +00:00
|
|
|
./configure --prefix=/opt/unbound --with-pthreads \
|
|
|
|
--with-username=_unbound --with-libevent --enable-event-api && \
|
2015-07-05 23:39:54 +00:00
|
|
|
make install && \
|
|
|
|
mv /opt/unbound/etc/unbound/unbound.conf /opt/unbound/etc/unbound/unbound.conf.example && \
|
|
|
|
rm -fr /opt/unbound/share/man && \
|
|
|
|
rm -fr /tmp/* /var/tmp/*
|
|
|
|
|
2017-03-12 19:25:52 +00:00
|
|
|
ENV LIBSODIUM_VERSION 1.0.12
|
2017-03-12 19:52:33 +00:00
|
|
|
ENV LIBSODIUM_SHA256 b8648f1bb3a54b0251cf4ffa4f0d76ded13977d4fa7517d988f4c902dd8e2f95
|
2015-07-05 23:39:54 +00:00
|
|
|
ENV LIBSODIUM_DOWNLOAD_URL https://download.libsodium.org/libsodium/releases/libsodium-${LIBSODIUM_VERSION}.tar.gz
|
|
|
|
|
|
|
|
RUN set -x && \
|
|
|
|
mkdir -p /tmp/src && \
|
|
|
|
cd /tmp/src && \
|
2017-04-19 08:56:02 +00:00
|
|
|
wget -O libsodium.tar.gz $LIBSODIUM_DOWNLOAD_URL && \
|
2015-07-05 23:39:54 +00:00
|
|
|
echo "${LIBSODIUM_SHA256} *libsodium.tar.gz" | sha256sum -c - && \
|
|
|
|
tar xzf libsodium.tar.gz && \
|
|
|
|
rm -f libsodium.tar.gz && \
|
|
|
|
cd libsodium-${LIBSODIUM_VERSION} && \
|
2017-04-19 08:56:02 +00:00
|
|
|
env CFLAGS=-Ofast ./configure --disable-dependency-tracking && \
|
2015-07-05 23:39:54 +00:00
|
|
|
make check && make install && \
|
2017-04-19 08:56:02 +00:00
|
|
|
ldconfig /usr/local/lib && \
|
|
|
|
rm -fr /tmp/* /var/tmp/*
|
2015-07-05 23:39:54 +00:00
|
|
|
|
2017-05-06 19:15:17 +00:00
|
|
|
ENV DNSCRYPT_PROXY_VERSION 1.9.5
|
|
|
|
ENV DNSCRYPT_PROXY_SHA256 64021fabb7d5bab0baf681796d90ecd2095fb81381e6fb317a532039025a9399
|
2016-04-19 06:19:45 +00:00
|
|
|
ENV DNSCRYPT_PROXY_DOWNLOAD_URL https://download.dnscrypt.org/dnscrypt-proxy/dnscrypt-proxy-${DNSCRYPT_PROXY_VERSION}.tar.gz
|
2015-07-05 23:39:54 +00:00
|
|
|
|
|
|
|
RUN set -x && \
|
|
|
|
mkdir -p /tmp/src && \
|
|
|
|
cd /tmp/src && \
|
2017-04-19 08:56:02 +00:00
|
|
|
wget -O dnscrypt-proxy.tar.gz $DNSCRYPT_PROXY_DOWNLOAD_URL && \
|
2015-07-05 23:39:54 +00:00
|
|
|
echo "${DNSCRYPT_PROXY_SHA256} *dnscrypt-proxy.tar.gz" | sha256sum -c - && \
|
2015-07-06 09:24:45 +00:00
|
|
|
tar xzf dnscrypt-proxy.tar.gz && \
|
2015-07-05 23:39:54 +00:00
|
|
|
rm -f dnscrypt-proxy.tar.gz && \
|
|
|
|
cd dnscrypt-proxy-${DNSCRYPT_PROXY_VERSION} && \
|
|
|
|
mkdir -p /opt/dnscrypt-proxy/empty && \
|
|
|
|
groupadd _dnscrypt-proxy && \
|
|
|
|
useradd -g _dnscrypt-proxy -s /etc -d /opt/dnscrypt-proxy/empty _dnscrypt-proxy && \
|
2017-04-19 08:56:02 +00:00
|
|
|
env CFLAGS=-Os ./configure --disable-dependency-tracking --prefix=/opt/dnscrypt-proxy --disable-plugins && \
|
2015-07-05 23:39:54 +00:00
|
|
|
make install && \
|
|
|
|
rm -fr /opt/dnscrypt-proxy/share && \
|
|
|
|
rm -fr /tmp/* /var/tmp/*
|
|
|
|
|
2017-06-20 15:19:45 +00:00
|
|
|
ENV DNSCRYPT_WRAPPER_GIT_URL https://github.com/jedisct1/dnscrypt-wrapper.git
|
|
|
|
ENV DNSCRYPT_WRAPPER_GIT_BRANCH xchacha20
|
2015-07-05 23:39:54 +00:00
|
|
|
|
2017-04-19 08:56:02 +00:00
|
|
|
COPY queue.h /tmp
|
|
|
|
|
2015-07-05 23:39:54 +00:00
|
|
|
RUN set -x && \
|
|
|
|
mkdir -p /tmp/src && \
|
|
|
|
cd /tmp/src && \
|
2017-06-20 15:19:45 +00:00
|
|
|
git clone --branch=${DNSCRYPT_WRAPPER_GIT_BRANCH} ${DNSCRYPT_WRAPPER_GIT_URL} && \
|
|
|
|
cd dnscrypt-wrapper && \
|
2017-04-19 08:56:02 +00:00
|
|
|
sed -i 's#<sys/queue.h>#"/tmp/queue.h"#' compat.h && \
|
|
|
|
sed -i 's#HAVE_BACKTRACE#NO_BACKTRACE#' compat.h && \
|
2015-07-05 23:39:54 +00: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 && \
|
|
|
|
make configure && \
|
2017-06-20 17:56:15 +00:00
|
|
|
env CFLAGS=-Ofast ./configure --prefix=/opt/dnscrypt-wrapper && \
|
2015-07-05 23:39:54 +00:00
|
|
|
make install && \
|
|
|
|
rm -fr /tmp/* /var/tmp/*
|
|
|
|
|
|
|
|
RUN set -x && \
|
2017-04-19 08:56:02 +00:00
|
|
|
apk del --purge $BUILD_DEPS && \
|
|
|
|
rm -rf /tmp/* /var/tmp/* /usr/local/include
|
2015-07-05 23:39:54 +00:00
|
|
|
|
|
|
|
RUN mkdir -p \
|
|
|
|
/etc/service/unbound \
|
|
|
|
/etc/service/watchdog
|
|
|
|
|
2015-07-07 22:19:02 +00:00
|
|
|
COPY entrypoint.sh /
|
2015-07-05 23:39:54 +00:00
|
|
|
|
2015-07-07 22:19:02 +00:00
|
|
|
COPY unbound.sh /etc/service/unbound/run
|
|
|
|
COPY unbound-check.sh /etc/service/unbound/check
|
2015-07-05 23:39:54 +00:00
|
|
|
|
2015-07-07 22:19:02 +00:00
|
|
|
COPY dnscrypt-wrapper.sh /etc/service/dnscrypt-wrapper/run
|
2015-07-05 23:39:54 +00:00
|
|
|
|
2015-07-07 22:19:02 +00:00
|
|
|
COPY key-rotation.sh /etc/service/key-rotation/run
|
|
|
|
COPY watchdog.sh /etc/service/watchdog/run
|
2015-07-05 23:39:54 +00:00
|
|
|
|
|
|
|
VOLUME ["/opt/dnscrypt-wrapper/etc/keys"]
|
|
|
|
|
2015-11-28 12:52:35 +00:00
|
|
|
EXPOSE 443/udp 443/tcp
|
2015-07-05 23:39:54 +00:00
|
|
|
|
2017-04-19 08:56:02 +00:00
|
|
|
CMD ["/sbin/start_runit"]
|
2015-07-05 23:39:54 +00:00
|
|
|
|
|
|
|
ENTRYPOINT ["/entrypoint.sh"]
|