Commit 6a3391d5 authored by Tomas Krizek's avatar Tomas Krizek Committed by Petr Špaček

docker: add images for resolvers

parent e45b5ce9
Respdiff contrib: Docker
========================
This directory contains Dockerfiles that create images which are used
for Knot Resolver CI testing.
* ``bind/``: BIND9 compiled from git tag/branch.
* ``unbound/``: Unbound from latest ``*.tar.gz``.
* ``knot-resolver-buildenv/``: Build environment for Knot Resolver.
* ``knot-resolver-fedora/``: Experimental Knot Resolver build on Fedora.
* ``knot-resolver/``: Knot Resolver compiled from specific git sha.
These containers are also available in our
`registry <https://gitlab.labs.nic.cz/knot/respdiff/container_registry>`__.
``knot-resolver`` container
---------------------------
The ``knot-resolver`` container is not available, as it's supposed to be
re-build often, for every commmit. Only the base build environment
``knot-resolver-buildenv`` is available from the registry.
To build the container locally, with the desired git version:
.. code-block:: console
$ export GIT_SHA=9a2bf9bfa7c3d4a9bcc83357895c5402bb3cab94
$ docker build -t knot-resolver:$GIT_SHA --build-arg GIT_SHA=$GIT_SHA knot-resolver
**Only use commit sha or tags.** Using branch names may lead to unexpected behaviour,
as the container cache with outdated code might be used, despite any updates to the
branch itself.
FROM ubuntu:latest
MAINTAINER Knot Resolver <knot-resolver@labs.nic.cz>
ARG GIT_TAG=v9_12_1
RUN apt-get update -qq
RUN apt-get upgrade -y -qqq
RUN apt-get install -y -qqq git build-essential make libssl-dev
RUN git clone --depth 1 --branch=$GIT_TAG https://gitlab.isc.org/isc-projects/bind9.git /var/opt/bind9
WORKDIR /var/opt/bind9
RUN ./configure --disable-backtrace --disable-symtable --with-libtool --enable-full-report --without-lmdb --without-zlib --without-gssapi --without-libxml2 --without-dlopen --disable-linux-caps
RUN make
CMD /var/opt/bind9/bin/named/named -c /etc/bind9/named.conf -f
FROM ubuntu:latest
MAINTAINER Knot Resolver <knot-resolver@labs.nic.cz>
RUN apt-get update -qq
RUN apt-get upgrade -y -qqq
# Install Knot DNS from sources
RUN apt-get -y -qqq install git-core make gcc libtool autoconf pkg-config \
liburcu-dev liblmdb-dev libgnutls28-dev libjansson-dev libedit-dev libidn11-dev
RUN git clone -b 2.6 --depth=1 https://gitlab.labs.nic.cz/knot/knot-dns.git /tmp/knot
WORKDIR /tmp/knot
RUN autoreconf -if
RUN ./configure --disable-static --disable-fastparser --disable-documentation
RUN make
RUN make install
RUN ldconfig
# Knot Resolver dependencies
RUN apt-get install -y -qqq git bsdmainutils build-essential pkg-config libknot-dev libgnutls28-dev liblmdb-dev libluajit-5.1-dev libuv1-dev luajit
FROM fedora:latest
MAINTAINER Knot Resolver <knot-resolver@labs.nic.cz>
# Knot DNS (build), Knot Resolver (build + runtime) dependencies
RUN dnf install -y \
git \
automake \
make \
libtool \
gcc \
gcc-c++ \
lua-socket-compat \
lua-sec-compat \
'pkgconfig(cmocka)' \
'pkgconfig(gnutls)' \
'pkgconfig(libedit)' \
'pkgconfig(libidn2)' \
'pkgconfig(libknot)' \
'pkgconfig(libzscanner)' \
'pkgconfig(libdnssec)' \
'pkgconfig(libsystemd)' \
'pkgconfig(libuv)' \
'pkgconfig(liburcu)' \
'pkgconfig(luajit)' \
'pkgconfig(lmdb)'
# Make Knot DNS
RUN git clone -b 2.6 --depth=1 https://gitlab.labs.nic.cz/knot/knot-dns.git /tmp/knot
WORKDIR /tmp/knot
RUN autoreconf -if
RUN ./configure --disable-static --enable-fastparser --disable-documentation
RUN make
RUN make install
RUN ldconfig
# Make Knot Resolver
RUN git clone --recursive -j8 https://gitlab.labs.nic.cz/knot/knot-resolver.git /var/opt/knot-resolver
WORKDIR /var/opt/knot-resolver
RUN git checkout v2.4.0
RUN mkdir .install
RUN make PREFIX=/var/opt/knot-resolver/.install LDFLAGS="-Wl,-rpath=/var/opt/knot-resolver/.install/lib"
RUN make install PREFIX=/var/opt/knot-resolver/.install
CMD /var/opt/knot-resolver/.install/sbin/kresd -c /etc/knot-resolver/kresd.conf -K /etc/knot-resolver/root.keys -v /dev/shm
FROM registry.labs.nic.cz/knot/respdiff/knot-resolver-buildenv
ARG GIT_SHA
MAINTAINER Knot Resolver <knot-resolver@labs.nic.cz>
RUN git clone --recursive -j8 https://gitlab.labs.nic.cz/knot/knot-resolver.git /var/opt/knot-resolver
WORKDIR /var/opt/knot-resolver
RUN git checkout $GIT_SHA
RUN mkdir .install
RUN make PREFIX=/var/opt/knot-resolver/.install LDFLAGS="-Wl,-rpath=/var/opt/knot-resolver/.install/lib"
RUN make install PREFIX=/var/opt/knot-resolver/.install
CMD /var/opt/knot-resolver/.install/sbin/kresd -c /etc/knot-resolver/kresd.conf -K /etc/knot-resolver/root.keys -v /dev/shm
FROM ubuntu:latest
MAINTAINER Knot Resolver <knot-resolver@labs.nic.cz>
RUN apt-get update -qq
RUN apt-get upgrade -y -qqq
RUN apt-get install -y -qqq build-essential make wget libssl-dev libexpat1-dev libevent-dev
RUN wget -O /tmp/unbound.tar.gz https://unbound.net/downloads/unbound-latest.tar.gz
RUN cd /tmp && tar -xzvf unbound.tar.gz && mv unbound-* /var/opt/unbound
WORKDIR /var/opt/unbound
RUN ./configure --with-libevent
RUN make
RUN make install
RUN useradd -s /usr/sbin/nologin -r unbound
CMD /var/opt/unbound/unbound -d
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment