diff --git a/Dockerfile b/Dockerfile index 9b4ea5d..83a6f48 100644 --- a/Dockerfile +++ b/Dockerfile @@ -49,13 +49,13 @@ RUN echo "=== Searching for nDPI files ===" && \ echo "=== Checking pkg-config ===" && \ pkg-config --cflags libndpi 2>/dev/null || echo "pkg-config failed" -# Fix nDPI compilation with proper linking order and paths +# Fix nDPI compilation using pkg-config output RUN echo "=== Attempting nDPI compilation ===" && \ ldconfig && \ - pkg-config --cflags --libs libndpi && \ + NDPI_FLAGS=$(pkg-config --cflags --libs libndpi) && \ + echo "Using nDPI flags: $NDPI_FLAGS" && \ gcc -o protocol_analyzer protocol_analyzer.c \ - -I/usr/local/include -L/usr/local/lib \ - -lndpi -lpcap -ljson-c -lpthread -lm \ + $NDPI_FLAGS -lpcap -ljson-c -lpthread \ && echo "✅ nDPI compilation successful" \ || (echo "❌ nDPI compilation failed with exit code $?" && exit 1)