From 481a7ab732f5d4ed213ca0b8cac85530cb58af12 Mon Sep 17 00:00:00 2001 From: Brian Lechthaler Date: Fri, 25 Dec 2020 23:13:39 -0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=E2=9C=A8Fix=20&=20Improve=20Surica?= =?UTF-8?q?ta=20Dockerfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Summary of Changes ## Bugfixes 🐛 * Add `py3-pip` (Alpine apk package for Python3 Pip). The absence of this APK dependency will cause the container build to fail. * Add a step to create an empty file at `/root/dist/empty.conf`, this ensures subsequent steps to cleanup don't cause the container build to fail. ## Improvements ✨ * Invoke `make` with `-j $(nproc)`. This forces `make` to spread the build process out over the number of logical cores available to the `make` process, significantly decreasing build times on multi-core systems. --- docker/suricata/Dockerfile.from.source | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docker/suricata/Dockerfile.from.source b/docker/suricata/Dockerfile.from.source index 97edc894..cbea5a5e 100644 --- a/docker/suricata/Dockerfile.from.source +++ b/docker/suricata/Dockerfile.from.source @@ -9,6 +9,7 @@ ADD dist/ /root/dist/ # Install packages #RUN sed -i 's/dl-cdn/dl-2/g' /etc/apk/repositories && \ RUN apk -U add \ + py3-pip \ ca-certificates \ curl \ file \ @@ -83,16 +84,17 @@ RUN apk -U add \ --enable-gccprotect \ --enable-pie \ --enable-luajit && \ - make && \ - make check && \ - make install && \ - make install-full && \ + make -j $(nproc) && \ + make check -j $(nproc) && \ + make install -j $(nproc) && \ + make install-full -j $(nproc) && \ # # Setup user, groups and configs addgroup -g 2000 suri && \ adduser -S -H -u 2000 -D -g 2000 suri && \ chmod 644 /etc/suricata/*.config && \ cp /root/dist/*.yaml /etc/suricata/ && \ + touch /root/dist/empty.conf && \ cp /root/dist/*.conf /etc/suricata/ && \ cp /root/dist/*.bpf /etc/suricata/ && \ mkdir -p /etc/suricata/rules && \