Last active
July 23, 2024 04:49
-
-
Save lokshunhung/7d3db72795990ca59cb5f38212f83e35 to your computer and use it in GitHub Desktop.
Dockerfile for ntopng + nProbe
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# run ntopng for visualization | |
ntopng \ | |
--http-port 3000 \ | |
--interface 'tcp://*:5556c' \ | |
--dump-flows 'clickhouse;clickhouse@9000;testdb;click;clickme' \ | |
--redis 'redis:6379@0' \ | |
--disable-login 1 \ | |
& | |
# run nprobe to collect and parse NetFlow traffic | |
nprobe \ | |
--zmq 'tcp://*:5556' \ | |
--interface none \ | |
-n none \ | |
--collector-port 2055 \ | |
-T "@NTOPNG@" \ | |
--collector-passthrough \ | |
& | |
# wait for any process to exit | |
wait -n | |
# exit with status of process that exited first | |
exit $? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:22.04 | |
LABEL org.opencontainers.image.authors="[email protected]" | |
RUN apt update --yes && \ | |
apt install --yes --quiet \ | |
wget lsb-release gnupg libelf1 && \ | |
wget --quiet http://apt.ntop.org/22.04/all/apt-ntop.deb && \ | |
dpkg --install apt-ntop.deb && \ | |
\ | |
apt update --yes && \ | |
apt install --yes --quiet \ | |
apt-transport-https ca-certificates dirmngr && \ | |
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 8919F6BD2B48D754 && \ | |
echo "deb https://packages.clickhouse.com/deb stable main" | tee /etc/apt/sources.list.d/clickhouse.list && \ | |
apt update --yes && \ | |
apt install --yes --quiet \ | |
clickhouse-client && \ | |
\ | |
apt update --yes && \ | |
echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections && \ | |
apt install --yes --quiet \ | |
ntopng ntopng-data \ | |
tzdata \ | |
nprobe && \ | |
apt clean --yes && \ | |
rm --recursive /var/lib/apt/lists/* | |
ENV TZ=Asia/Hong_Kong | |
RUN ln --symbolic --no-dereference --force \ | |
/usr/share/zoneinfo/$TZ /etc/localtime && \ | |
echo $TZ > /etc/timezone | |
COPY docker-run.sh . | |
ENTRYPOINT ["/bin/bash"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment