From 01f4d6c6eb174aec215f9526c04a1831e48b5edc Mon Sep 17 00:00:00 2001 From: Daniel Salzman Date: Mon, 22 Nov 2021 13:27:25 +0100 Subject: Dockerfile: add options and improve building - New option FASTPARSER=disable|enable - New option CHECK=disable|enable for unittests execution - Explicit CFLAGS="-g -O2 -DNDEBUG -D_FORTIFY_SOURCE=2 -fstack-protector-strong" - Added --enable-dnstap --- Dockerfile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index 2e8f83987..3085df1e5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,16 +30,23 @@ RUN apt-get update && \ # Build the project COPY . /knot-src WORKDIR /knot-src +ARG FASTPARSER=disable RUN autoreconf -if && \ + CFLAGS="-g -O2 -DNDEBUG -D_FORTIFY_SOURCE=2 -fstack-protector-strong" \ ./configure --prefix=/ \ --with-rundir=/rundir \ --with-storage=/storage \ --with-configdir=/config \ --with-module-dnstap=yes \ - --disable-fastparser \ + --${FASTPARSER}-fastparser \ + --enable-dnstap \ --disable-static \ --disable-documentation && \ - make -j$(grep -c ^processor /proc/cpuinfo) && \ + make -j$(grep -c ^processor /proc/cpuinfo) + +# Run unittests if requested and install the project +ARG CHECK=disable +RUN if [ "$CHECK" = "enable" ]; then make -j$(grep -c ^processor /proc/cpuinfo) check; fi && \ make install DESTDIR=/tmp/knot-install ## Final stage ## -- cgit v1.2.3