You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
dnscrypt-server-docker/Dockerfile

96 lines
3.4 KiB
Docker

FROM jedisct1/alpine-runit:latest
9 years ago
MAINTAINER Frank Denis
ENV SERIAL 2
9 years ago
6 years ago
ENV BUILD_DEPS make gcc musl-dev git libevent-dev expat-dev shadow autoconf file libressl-dev
ENV RUNTIME_DEPS bash util-linux coreutils findutils grep libressl ldns ldns-tools libevent expat libexecinfo coreutils drill
9 years ago
RUN set -x && \
apk --update upgrade && apk add $RUNTIME_DEPS $BUILD_DEPS
9 years ago
6 years ago
ENV UNBOUND_VERSION 1.8.2
ENV UNBOUND_SHA256 19f2235a8936d89e7dc919bbfcef355de759f220e36bb5e1e931ac000ed04993
ENV UNBOUND_DOWNLOAD_URL https://www.unbound.net/downloads/unbound-${UNBOUND_VERSION}.tar.gz
9 years ago
RUN set -x && \
mkdir -p /tmp/src && \
cd /tmp/src && \
wget -O unbound.tar.gz $UNBOUND_DOWNLOAD_URL && \
9 years ago
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 && \
./configure --prefix=/opt/unbound --with-pthreads \
--with-username=_unbound --with-libevent --enable-event-api && \
9 years ago
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/*
5 years ago
ENV LIBSODIUM_VERSION 1.0.17
ENV LIBSODIUM_SHA256 0cc3dae33e642cc187b5ceb467e0ad0e1b51dcba577de1190e9ffa17766ac2b1
9 years ago
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 && \
wget -O libsodium.tar.gz $LIBSODIUM_DOWNLOAD_URL && \
9 years ago
echo "${LIBSODIUM_SHA256} *libsodium.tar.gz" | sha256sum -c - && \
tar xzf libsodium.tar.gz && \
rm -f libsodium.tar.gz && \
cd libsodium-${LIBSODIUM_VERSION} && \
env CFLAGS=-Ofast ./configure --disable-dependency-tracking && \
9 years ago
make check && make install && \
ldconfig /usr/local/lib && \
rm -fr /tmp/* /var/tmp/*
9 years ago
ENV DNSCRYPT_WRAPPER_GIT_URL https://github.com/jedisct1/dnscrypt-wrapper.git
6 years ago
ENV DNSCRYPT_WRAPPER_GIT_BRANCH xchacha-stamps
9 years ago
COPY queue.h /tmp
9 years ago
RUN set -x && \
mkdir -p /tmp/src && \
cd /tmp/src && \
git clone --branch=${DNSCRYPT_WRAPPER_GIT_BRANCH} ${DNSCRYPT_WRAPPER_GIT_URL} && \
cd dnscrypt-wrapper && \
sed -i 's#<sys/queue.h>#"/tmp/queue.h"#' compat.h && \
sed -i 's#HAVE_BACKTRACE#NO_BACKTRACE#' compat.h && \
9 years ago
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 && \
9 years ago
make install && \
rm -fr /tmp/* /var/tmp/*
RUN set -x && \
6 years ago
echo apk del --purge $BUILD_DEPS && \
echo rm -rf /tmp/* /var/tmp/* /usr/local/include
9 years ago
RUN mkdir -p \
/etc/service/unbound \
/etc/service/watchdog
9 years ago
COPY entrypoint.sh /
9 years ago
9 years ago
COPY unbound.sh /etc/service/unbound/run
COPY unbound-check.sh /etc/service/unbound/check
9 years ago
9 years ago
COPY dnscrypt-wrapper.sh /etc/service/dnscrypt-wrapper/run
9 years ago
9 years ago
COPY key-rotation.sh /etc/service/key-rotation/run
COPY watchdog.sh /etc/service/watchdog/run
9 years ago
VOLUME ["/opt/dnscrypt-wrapper/etc/keys"]
EXPOSE 443/udp 443/tcp
9 years ago
CMD ["/sbin/start_runit"]
9 years ago
ENTRYPOINT ["/entrypoint.sh"]