1
1
mirror of https://github.com/dnscrypt/dnscrypt-server-docker synced 2024-11-22 15:32:01 +01:00
dnscrypt-server-docker/Dockerfile

93 lines
3.2 KiB
Docker
Raw Normal View History

2017-04-19 10:56:02 +02:00
FROM jedisct1/alpine-runit:latest
2015-07-06 01:39:54 +02:00
MAINTAINER Frank Denis
ENV SERIAL 2
2015-07-06 01:39:54 +02:00
2018-01-22 20:23:54 +01:00
ENV BUILD_DEPS make gcc musl-dev git libevent-dev expat-dev shadow autoconf file libressl-dev
2018-01-22 15:57:50 +01:00
ENV RUNTIME_DEPS bash util-linux coreutils findutils grep libressl ldns ldns-tools libevent expat libexecinfo coreutils drill
2015-07-06 01:39:54 +02:00
RUN set -x && \
2017-04-19 10:56:02 +02:00
apk --update upgrade && apk add $RUNTIME_DEPS $BUILD_DEPS
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
ENV UNBOUND_GIT_REVISION 64c4e69b073db13236d278cc98251b4f51cacc0c
2015-07-06 01:39:54 +02:00
RUN set -x && \
mkdir -p /tmp/src && \
cd /tmp/src && \
2019-02-05 18:12:37 +01:00
git clone "$UNBOUND_GIT_URL" && \
git checkout "$UNBOUND_GIT_REVISION" && \
cd unbound && \
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 && \
2015-07-06 01:39:54 +02: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/*
2019-01-07 12:42:27 +01:00
ENV LIBSODIUM_VERSION 1.0.17
ENV LIBSODIUM_SHA256 0cc3dae33e642cc187b5ceb467e0ad0e1b51dcba577de1190e9ffa17766ac2b1
2015-07-06 01:39:54 +02: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 10:56:02 +02:00
wget -O libsodium.tar.gz $LIBSODIUM_DOWNLOAD_URL && \
2015-07-06 01:39:54 +02: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 10:56:02 +02:00
env CFLAGS=-Ofast ./configure --disable-dependency-tracking && \
2015-07-06 01:39:54 +02:00
make check && make install && \
2017-04-19 10:56:02 +02:00
ldconfig /usr/local/lib && \
rm -fr /tmp/* /var/tmp/*
2015-07-06 01:39:54 +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
2015-07-06 01:39:54 +02:00
RUN set -x && \
mkdir -p /tmp/src && \
cd /tmp/src && \
git clone --branch=${DNSCRYPT_WRAPPER_GIT_BRANCH} ${DNSCRYPT_WRAPPER_GIT_URL} && \
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 && \
make configure && \
env CFLAGS=-Ofast ./configure --prefix=/opt/dnscrypt-wrapper && \
2015-07-06 01:39:54 +02:00
make install && \
rm -fr /tmp/* /var/tmp/*
RUN set -x && \
2018-01-22 20:23:54 +01:00
echo apk del --purge $BUILD_DEPS && \
echo rm -rf /tmp/* /var/tmp/* /usr/local/include
2015-07-06 01:39:54 +02:00
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"]
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"]