Skip to content
Snippets Groups Projects
Commit 8ca669ec authored by Jan Včelák's avatar Jan Včelák :rocket:
Browse files

Merge branch 'docker' into 'master'

Dockerfiles for Knot DNS & tests

Automatic build is in the registry https://registry.hub.docker.com/u/cznic/knot/

See merge request !328
parents b8853c88 301833d7
No related branches found
No related tags found
1 merge request!330Knsupdate pubkey processing fix
FROM debian:jessie
MAINTAINER Marek Vavrusa <marek.vavrusa@nic.cz>
# Select entrypoint
WORKDIR /root
CMD ["/usr/local/sbin/knotd"]
# Expose port
EXPOSE 53
# Environment
ENV THREADS 4
ENV BUILD_PKGS git-core make gcc libtool autoconf pkg-config flex bison libssl-dev liburcu-dev liblmdb-dev
ENV RUNTIME_PKGS libssl1.0.0 liburcu2 liblmdb0
# Install dependencies and sources
RUN apt-get -q -y update && \
apt-get install -q -y ${BUILD_PKGS} ${RUNTIME_PKGS} && \
# Compile sources
git clone -b master https://gitlab.labs.nic.cz/labs/knot.git /knot-src && \
cd /knot-src && \
autoreconf -if && \
./configure --disable-static && \
make -j${THREADS} && \
make install && \
ldconfig && \
# Trim down the image
cd && \
rm -rf /knot-src && \
apt-get purge -q -y ${BUILD_PKGS} && \
apt-get autoremove -q -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
FROM cznic/knot:latest
MAINTAINER Marek Vavrusa <marek.vavrusa@nic.cz>
# Environment
ENV RUNTIME_PKGS gawk python3 python3-pip bind9 bind9utils valgrind lsof gdb
# Copy test cases
COPY . /knot-src/tests-extra
# Select entrypoint
WORKDIR /knot-src/tests-extra
ENTRYPOINT ["/knot-src/tests-extra/runtests.py"]
# Install dependencies and sources
RUN apt-get -q -y update && \
apt-get install -q -y ${RUNTIME_PKGS} && \
pip3 install -r /knot-src/tests-extra/requirements.txt && \
# Link the prebuilt executables
mkdir -p /knot-src/src && \
ln -sfn /usr/local/sbin/knotd /knot-src/src/knotd && \
ln -sfn /usr/local/sbin/knotc /knot-src/src/knotc && \
# Trim down the image
apt-get autoremove -q -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
......@@ -8,6 +8,7 @@ dnssec-keygen
dnssec-verify
Bind 9.9.x
lsof
gawk
(valgrind)
(gdb)
......@@ -27,3 +28,22 @@ Allow ptrace:
or
change file /etc/sysctl.d/10-ptrace.conf
kernel.yama.ptrace_scope = 0
Running in docker container:
----------------------------
There is a Dockerfile that can be used to build containers with the tests-extra,
the main benefit is that each test runs in an isolated container and can be run in parallel.
Run tests on the upstream branch:
---------------------------------
$ docker pull cznic/knot:tests-extra # Or build with 'docker build -t tests-extra .'
$ docker run -it -v cznic/knot:tests-extra basic
Run tests on the local executables:
-----------------------------------
You can bind-mount the /src with the current working copy.
$ docker run -it -v $(pwd)/..:/knot-src cznic/knot:tests-extra basic
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment