Dockerfile 4.92 KB
Newer Older
1
FROM @SOURCE_IMAGE@
2 3
MAINTAINER BIND 9 Developers <bind9-dev@isc.org>
ENV DEBIAN_FRONTEND noninteractive
4 5
ENV ATF_VERSION 0.21
ENV LUTOK_VERSION 0.4
Michal Nowak's avatar
Michal Nowak committed
6
ENV KYUA_GIT_COMMIT @KYUA_GIT_COMMIT@
Ondřej Surý's avatar
Ondřej Surý committed
7
RUN apt-get -y update
8
RUN apt-get -y dist-upgrade
9 10
RUN apt-get -y install apt-utils curl
RUN if [ "@CLANG@" -ge "9" ] 2>/dev/null; then \
11
	apt-get -y install apt-transport-https; \
Ondřej Surý's avatar
Ondřej Surý committed
12
	curl -sSL -o /etc/apt/trusted.gpg.d/llvm.asc https://apt.llvm.org/llvm-snapshot.gpg.key; \
13
	echo "deb http://apt.llvm.org/@VERSION@/ llvm-toolchain-@VERSION@-@CLANG@ main" >> /etc/apt/sources.list.d/llvm.list; \
14
	fi
15
RUN if [ "@COCCINELLE@" = "yes" ]; then \
Ondřej Surý's avatar
Ondřej Surý committed
16 17
	curl -sSL -o /etc/apt/trusted.gpg.d/coccinelle.gpg https://packages.sury.org/coccinelle/apt.gpg; \
	echo "deb https://packages.sury.org/coccinelle/ @VERSION@ main" > /etc/apt/sources.list.d/coccinelle.list; \
18
	fi
19 20 21 22 23 24 25 26
RUN if [ "@CPPCHECK@" = "yes" ]; then \
	curl -sSL -o /etc/apt/trusted.gpg.d/cppcheck.gpg https://packages.sury.org/cppcheck/apt.gpg; \
	echo "deb https://packages.sury.org/cppcheck/ @VERSION@ main" > /etc/apt/sources.list.d/cppcheck.list; \
	fi
RUN if [ "@RESPDIFF@" = "yes" ]; then \
	curl -sSL -o /etc/apt/trusted.gpg.d/lmdb.gpg https://packages.sury.org/lmdb/apt.gpg; \
	echo "deb https://packages.sury.org/lmdb/ @VERSION@ main" > /etc/apt/sources.list.d/lmdb.list; \
	fi
27 28
RUN apt-get -y update
RUN apt-get -y dist-upgrade
Witold Krecicki's avatar
Witold Krecicki committed
29 30 31 32 33
RUN apt-get -y install		\
	autoconf		\
	automake		\
	autotools-dev		\
	bash-completion		\
Ondřej Surý's avatar
Ondřej Surý committed
34
	bc			\
35
	bear			\
Witold Krecicki's avatar
Witold Krecicki committed
36 37 38
	bison			\
	build-essential		\
	ccache			\
39
	docbook-xsl		\
40
	gdb			\
Witold Krecicki's avatar
Witold Krecicki committed
41
	git			\
42
	idn2			\
Witold Krecicki's avatar
Witold Krecicki committed
43
	libcap2-dev		\
Ondřej Surý's avatar
Ondřej Surý committed
44
	libcmocka-dev		\
Witold Krecicki's avatar
Witold Krecicki committed
45 46 47
	libdb-dev		\
	libgeoip-dev		\
	libidn2-0-dev		\
48
	libio-socket-inet6-perl	\
Witold Krecicki's avatar
Witold Krecicki committed
49
	libjson-c-dev		\
50
	libjson-perl		\
Witold Krecicki's avatar
Witold Krecicki committed
51 52 53 54 55
	libkrb5-dev		\
	libldap2-dev		\
	liblmdb-dev		\
	liblua5.1-0-dev		\
	liblua5.2-dev		\
56
	libmaxminddb-dev	\
Witold Krecicki's avatar
Witold Krecicki committed
57 58 59 60
	libnet-dns-perl		\
	libtool			\
	libsqlite3-dev		\
	libssl-dev		\
61
	libuv1-dev		\
62
	libxml-simple-perl	\
Witold Krecicki's avatar
Witold Krecicki committed
63
	libxml2-dev		\
64
	libxml2-utils		\
Witold Krecicki's avatar
Witold Krecicki committed
65 66 67 68 69 70 71
	net-tools		\
	perl			\
	pkg-config		\
	procps			\
	python3			\
	python3-ply		\
	python3-dnspython	\
72 73
	python3-sphinx		\
	python3-sphinx-rtd-theme	\
Witold Krecicki's avatar
Witold Krecicki committed
74
	sudo			\
75
	xsltproc		\
76
	zip			\
77
	zlib1g-dev
78 79 80 81 82
RUN if [ "@VERSION@" = "buster" ]; then apt-get -y install \
	python \
	python-dnspython \
	python-ply \
; fi
83 84 85 86 87 88 89
RUN if [ "@ABI_CHECK@" = "yes" ]; then \
	apt-get -y install abi-compliance-checker abi-dumper w3m; \
	# FIXME: This is Debian bug https://bugs.debian.org/952596. Before it
	# gets fixed we patch with a Fedora version of the upstream fix (the
	# upstream one does not apply cleanly).
	curl -s https://src.fedoraproject.org/rpms/abi-dumper/raw/master/f/0001-Support-for-new-elfutils-Fedora-30.patch | patch /usr/bin/abi-dumper; \
	fi
90
RUN if [ "@CLANG@" -ge "9" ] 2>/dev/null; then \
91
	apt-get -y install \
92 93 94 95 96 97
		llvm-@CLANG@ \
		lldb-@CLANG@ \
		clang-@CLANG@ \
		clang-tools-@CLANG@ \
		clang-format-@CLANG@ \
		clang-tidy-@CLANG@; \
98
	fi
99 100 101
RUN if [ "@COCCINELLE@" = "yes" ]; then apt-get -y install coccinelle; fi
RUN if [ "@COMPILEDB@" = "yes" ]; then apt-get -y install python3-pip && pip3 install compiledb; fi
RUN if [ "@CPPCHECK@" = "yes" ]; then apt-get -y install cppcheck; fi
102
RUN if [ "@DNSTAP@" = "yes" ]; then apt-get -y install libfstrm-dev libprotobuf-c-dev protobuf-c-compiler; fi
103 104
RUN if [ "@RESPDIFF@" = "yes" ]; then apt-get -y install python3-dpkt python3-lmdb python3-numpy python3-scipy python3-tabulate; fi
RUN if [ "@SHELLCHECK@" = "yes" ]; then apt-get -y install shellcheck; fi
105 106
RUN if [ "@SOFTHSM@" -ge "2" ] 2>/dev/null; then apt-get -y install libsofthsm2 softhsm2; fi
RUN if [ "@SOFTHSM@" -lt "2" ] 2>/dev/null; then apt-get -y install libsofthsm softhsm; fi
Michal Nowak's avatar
Michal Nowak committed
107 108 109 110 111 112
COPY kyua.tar /
RUN if [ ! -s /kyua.tar ]; then \
	curl -sSL "https://github.com/jmmv/atf/releases/download/atf-${ATF_VERSION}/atf-${ATF_VERSION}.tar.gz" | tar -xz -C /usr/src && \
	cd "/usr/src/atf-${ATF_VERSION}" && \
	autoreconf -fi && \
	./configure --prefix /usr && \
113
	make -j@BUILD_PARALLEL_JOBS@ && \
Michal Nowak's avatar
Michal Nowak committed
114 115 116 117 118 119 120 121
	make install && \
	make install DESTDIR=/tmp/kyua-cache-root && \
	cd .. && rm -rf /tmp/kyua-cache-root/usr/tests "/usr/src/atf-${ATF_VERSION}" && \
	ldconfig && \
	curl -sSL "https://github.com/jmmv/lutok/releases/download/lutok-${LUTOK_VERSION}/lutok-${LUTOK_VERSION}.tar.gz" | tar -xz -C /usr/src && \
	cd "/usr/src/lutok-${LUTOK_VERSION}" && \
	autoreconf -fi && \
	./configure --prefix /usr && \
122
	make -j@BUILD_PARALLEL_JOBS@ && \
Michal Nowak's avatar
Michal Nowak committed
123 124 125 126 127 128 129
	make install && \
	make install DESTDIR=/tmp/kyua-cache-root && \
	cd .. && rm -rf /tmp/kyua-cache-root/usr/tests "/usr/src/lutok-${LUTOK_VERSION}" && \
	ldconfig && \
	curl -sSL "https://github.com/Mno-hime/kyua/archive/${KYUA_GIT_COMMIT}.tar.gz" | tar -xz -C /usr/src && \
	cd "/usr/src/kyua-${KYUA_GIT_COMMIT}" && \
	./configure --prefix /usr && \
130
	make -j@BUILD_PARALLEL_JOBS@ && \
Michal Nowak's avatar
Michal Nowak committed
131 132 133 134 135 136
	make install && \
	make install DESTDIR=/tmp/kyua-cache-root && \
	cd .. && rm -rf /tmp/kyua-cache-root/usr/tests "/usr/src/kyua-${KYUA_GIT_COMMIT}" && \
	tar --directory /tmp/kyua-cache-root --create --file /kyua.tar . ; \
    fi
RUN tar --extract --file /kyua.tar
137
RUN ldconfig