1
1
mirror of https://github.com/dnscrypt/dnscrypt-server-docker synced 2024-11-26 06:13:49 +01:00

Merge remote-tracking branch 'org/master'

* org/master:
  Enable Travis CI with basic Docker build testing
  Properly cleanup apk build dependency in Dockerfile
  Use multi-thread to "make" in Dockerfile to speedup build
  Specify git clone depth in Dockerfile to speed up git cloning
  Clone libsodium with specify single branch in Dockerfile
  Replace apk parameter `--update` with `--no-cache` to reduce size
This commit is contained in:
Frank Denis 2019-05-05 09:10:25 +02:00
commit eaf9f3b8cb
2 changed files with 28 additions and 10 deletions

14
.travis.yml Normal file

@ -0,0 +1,14 @@
---
dist: xenial
language: minimal
git:
depth: 5
script:
- docker build -t dnscrypt-server-docker-ci-test .
services:
- docker

@ -6,38 +6,41 @@ ENV BUILD_DEPS make gcc musl-dev git libevent-dev expat-dev shadow autoconf fi
ENV RUNTIME_DEPS bash util-linux coreutils findutils grep openssl ldns ldns-tools libevent expat libexecinfo coreutils drill ca-certificates
RUN set -x && \
apk --update upgrade && apk add --no-cache $RUNTIME_DEPS $BUILD_DEPS && \
apk --no-cache upgrade && apk add --no-cache $RUNTIME_DEPS && \
update-ca-certificates 2> /dev/null || true
ENV UNBOUND_GIT_URL https://github.com/jedisct1/unbound.git
ENV UNBOUND_GIT_REVISION 7bd08b7a9987a0780892131f8590b6e384194bbc
RUN set -x && \
apk add --no-cache $BUILD_DEPS && \
mkdir -p /tmp/src && \
cd /tmp/src && \
git clone "$UNBOUND_GIT_URL" && \
git clone --depth=1000 "$UNBOUND_GIT_URL" && \
cd unbound && \
git checkout "$UNBOUND_GIT_REVISION" && \
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 && \
make install && \
make -j$(getconf _NPROCESSORS_ONLN) install && \
mv /opt/unbound/etc/unbound/unbound.conf /opt/unbound/etc/unbound/unbound.conf.example && \
apk del --purge $BUILD_DEPS && \
rm -fr /opt/unbound/share/man && \
rm -fr /tmp/* /var/tmp/*
ENV LIBSODIUM_GIT_URL https://github.com/jedisct1/libsodium.git
RUN set -x && \
apk add --no-cache $BUILD_DEPS && \
mkdir -p /tmp/src && \
cd /tmp/src && \
git clone "$LIBSODIUM_GIT_URL" && \
git clone --depth=1 --branch stable "$LIBSODIUM_GIT_URL" && \
cd libsodium && \
git checkout stable && \
env CFLAGS=-Ofast ./configure --disable-dependency-tracking && \
make check && make install && \
make -j$(getconf _NPROCESSORS_ONLN) check && make -j$(getconf _NPROCESSORS_ONLN) install && \
ldconfig /usr/local/lib && \
apk del --purge $BUILD_DEPS && \
rm -fr /tmp/* /var/tmp/*
ENV DNSCRYPT_WRAPPER_GIT_URL https://github.com/jedisct1/dnscrypt-wrapper.git
@ -46,9 +49,10 @@ ENV DNSCRYPT_WRAPPER_GIT_BRANCH xchacha-stamps
COPY queue.h /tmp
RUN set -x && \
apk add --no-cache $BUILD_DEPS && \
mkdir -p /tmp/src && \
cd /tmp/src && \
git clone --branch=${DNSCRYPT_WRAPPER_GIT_BRANCH} ${DNSCRYPT_WRAPPER_GIT_URL} && \
git clone --depth=1 --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 && \
@ -57,13 +61,13 @@ RUN set -x && \
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 && \
make -j$(getconf _NPROCESSORS_ONLN) configure && \
env CFLAGS=-Ofast ./configure --prefix=/opt/dnscrypt-wrapper && \
make install && \
make -j$(getconf _NPROCESSORS_ONLN) install && \
apk del --purge $BUILD_DEPS && \
rm -fr /tmp/* /var/tmp/*
RUN set -x && \
echo apk del --purge $BUILD_DEPS && \
echo rm -rf /tmp/* /var/tmp/* /usr/local/include
RUN mkdir -p \