Enhance Dockerfile for protocol analyzer: add debug checks for nDPI installation and update include paths
This commit is contained in:
22
Dockerfile
22
Dockerfile
@@ -16,11 +16,14 @@ RUN apt-get update && apt-get install -y \
|
||||
libtool \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Build and install nDPI
|
||||
# Try to install nDPI from package manager first
|
||||
RUN apt-get update && apt-get install -y libndpi-dev || echo "Package not available"
|
||||
|
||||
# Build and install nDPI from source as fallback
|
||||
RUN git clone https://github.com/ntop/nDPI.git /tmp/nDPI && \
|
||||
cd /tmp/nDPI && \
|
||||
./autogen.sh && \
|
||||
./configure --with-pic && \
|
||||
./configure --prefix=/usr/local && \
|
||||
make && \
|
||||
make install && \
|
||||
ldconfig && \
|
||||
@@ -39,11 +42,18 @@ COPY lib/ ./lib/
|
||||
COPY protocol_analyzer.c ./
|
||||
|
||||
# Debug: Check what nDPI installed
|
||||
RUN find /usr -name "*ndpi*" -type f 2>/dev/null | head -10
|
||||
RUN find /usr -name "*.h" -path "*ndpi*" 2>/dev/null | head -10
|
||||
RUN echo "=== Searching for nDPI files ===" && \
|
||||
find /usr -name "*ndpi*" -type f 2>/dev/null | head -20 && \
|
||||
echo "=== Searching for nDPI headers ===" && \
|
||||
find /usr -name "ndpi_api.h" 2>/dev/null && \
|
||||
echo "=== Checking pkg-config ===" && \
|
||||
pkg-config --cflags libndpi 2>/dev/null || echo "pkg-config failed"
|
||||
|
||||
# Compile the C protocol analyzer
|
||||
RUN gcc -o protocol_analyzer protocol_analyzer.c -I/usr/local/include -I/usr/local/include/libndpi-4.8.0/libndpi -L/usr/local/lib -lndpi -lpcap
|
||||
# Try multiple compilation approaches
|
||||
RUN (gcc -o protocol_analyzer protocol_analyzer.c $(pkg-config --cflags --libs libndpi) -lpcap) || \
|
||||
(gcc -o protocol_analyzer protocol_analyzer.c -I/usr/local/include -L/usr/local/lib -lndpi -lpcap) || \
|
||||
(gcc -o protocol_analyzer protocol_analyzer.c -I/usr/include -L/usr/lib -lndpi -lpcap) || \
|
||||
echo "All compilation attempts failed"
|
||||
|
||||
# Compile the application
|
||||
RUN dart compile exe lib/main.dart -o waylume_server
|
||||
|
||||
Reference in New Issue
Block a user