summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Včelák <jan.vcelak@nic.cz>2015-02-04 10:30:06 +0100
committerJan Včelák <jan.vcelak@nic.cz>2015-02-04 10:30:06 +0100
commit8ca669ecd710b4f9c451325ba8cb72621d57c595 (patch)
tree4ddc40c55b4ab4f2dc78bc41b2dae7d915f8beed
parentzscanner: update NOTES (diff)
parentdocker: cleanup in tests-extra (diff)
downloadknot-8ca669ecd710b4f9c451325ba8cb72621d57c595.tar.xz
knot-8ca669ecd710b4f9c451325ba8cb72621d57c595.zip
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
-rw-r--r--scripts/Dockerfile33
-rw-r--r--tests-extra/Dockerfile25
-rw-r--r--tests-extra/README20
3 files changed, 78 insertions, 0 deletions
diff --git a/scripts/Dockerfile b/scripts/Dockerfile
new file mode 100644
index 000000000..75e981455
--- /dev/null
+++ b/scripts/Dockerfile
@@ -0,0 +1,33 @@
+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/*
diff --git a/tests-extra/Dockerfile b/tests-extra/Dockerfile
new file mode 100644
index 000000000..5de50ad8b
--- /dev/null
+++ b/tests-extra/Dockerfile
@@ -0,0 +1,25 @@
+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/*
diff --git a/tests-extra/README b/tests-extra/README
index 11621a991..898ee16ee 100644
--- a/tests-extra/README
+++ b/tests-extra/README
@@ -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