knot-dns/Dockerfile
2020-07-20 10:03:47 +02:00

75 lines
1.5 KiB
Docker

## Intermediate stage ##
FROM debian:stable-slim
# Environment
ENV BUILD_PKGS \
autoconf \
automake \
gcc \
git-core \
libedit-dev \
libfstrm-dev \
libgnutls28-dev \
libidn2-0-dev \
liblmdb-dev \
libmaxminddb-dev \
libnghttp2-dev \
libprotobuf-c-dev \
libtool \
liburcu-dev \
make \
pkg-config \
protobuf-c-compiler
# Install dependencies
RUN apt-get update && \
apt-get install -yqq ${BUILD_PKGS}
# Build the project
COPY . /knot-src
WORKDIR /knot-src
RUN autoreconf -if && \
./configure --prefix=/ \
--with-rundir=/rundir \
--with-storage=/storage \
--with-configdir=/config \
--with-module-dnstap=yes \
--disable-fastparser \
--disable-static \
--disable-documentation && \
make -j$(grep -c ^processor /proc/cpuinfo) && \
make install DESTDIR=/tmp/knot-install
## Final stage ##
FROM debian:stable-slim
MAINTAINER Knot DNS <knot-dns@labs.nic.cz>
# Environment
ENV RUNTIME_PKGS \
libedit2 \
libfstrm0 \
libgnutls30 \
libidn2-0 \
liblmdb0 \
libmaxminddb0 \
libnghttp2-14 \
libprotobuf-c1 \
liburcu6
# Copy artifacts
COPY --from=0 /tmp/knot-install/ /
# Install dependencies
RUN apt-get update && \
apt-get install -yqq ${RUNTIME_PKGS} && \
rm -rf /var/lib/apt/lists/* && \
ldconfig
# Expose port
EXPOSE 53/UDP
EXPOSE 53/TCP
# Prepare shared directories
VOLUME /config
VOLUME /rundir
VOLUME /storage