add Docker related file

This commit is contained in:
macauley_cheng
2022-12-21 17:28:21 +08:00
committed by Toni
parent e9443d7618
commit 3dcc13b052
2 changed files with 36 additions and 0 deletions

25
Dockerfile Normal file
View File

@@ -0,0 +1,25 @@
FROM ubuntu:22.10 as builder
WORKDIR /root
RUN apt-get -y update && apt-get install -y git cmake pkg-config libpcap-dev autoconf libtool
RUN git clone https://github.com/utoni/nDPId.git
#for dev, uncomment below
#RUN mkdir /root/nDPId
#COPY . /root/nDPId/
RUN cd nDPId && mkdir build && cd build && cmake .. -DBUILD_NDPI=ON && make
FROM ubuntu:22.10
WORKDIR /root
RUN apt-get -y update && apt-get -y install libpcap-dev
COPY --from=builder /root/nDPId/libnDPI/ /root/
COPY --from=builder /root/nDPId/build/nDPIsrvd /root/nDPId/build/nDPId /root/
#RUN echo "#!/bin/bash\n" \
# "/root/nDPIsrvd -d\n"\
# "/root/nDPId \n" > run.sh && cat run.sh && chmod +x run.sh
#ENTRYPOINT ["/root/run.sh"]

11
docker-compose.yml Normal file
View File

@@ -0,0 +1,11 @@
services:
ndpid:
build: .
image: ndpid:latest
network_mode: "host"
entrypoint: "/bin/bash"
command: -c "
/root/nDPIsrvd -d ;
/root/nDPId -d ;
/root/nDPIsrvd-kafka -b 124.219.108.6:9092 -t events -s"