This repository has been archived by the owner on Apr 5, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1575c8b
commit 7a98deb
Showing
1 changed file
with
31 additions
and
16 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,40 @@ | ||
FROM node:6.10-alpine | ||
### Alpine Driftnet Builder Image ### | ||
FROM alpine:3.6 as builder | ||
|
||
ENV PROJECT_PATH /driftnet | ||
# Install the needed dependencies to build driftnet | ||
RUN apk -U add --no-cache git build-base libpcap-dev | ||
|
||
# Download the dldewolf fork of driftnet. We specifically want this version | ||
# as it supports PNG files. | ||
RUN git clone https://github.com/bldewolf/driftnet.git /driftnet | ||
|
||
# We will need to make some modifications to the makefile so that we don't attempt | ||
# to build with GTK. As we won't have any kind of a GUI to interface to, its quite | ||
# silly to add all of that complexity. Once the modifications are complete, we will | ||
# then build driftnet. | ||
WORKDIR /driftnet | ||
RUN sed -i 's/#CFLAGS += -DNO_DISPLAY_WINDOW/CFLAGS += -DNO_DISPLAY_WINDOW/g' Makefile | ||
RUN sed -i 's/CFLAGS += `pkg-config --cflags gtk+-2.0` `pkg-config --cflags libpng`//g' Makefile | ||
RUN sed -i 's/LDLIBS += -ljpeg -lgif `pkg-config --libs gtk+-2.0` `pkg-config --libs libpng`//g' Makefile | ||
RUN make | ||
|
||
|
||
### Dofler Driftnet Image ### | ||
FROM node:9.1-alpine | ||
ENV MONITOR_INTERFACE "" | ||
ENV IMAGE_PATH "/images" | ||
ENV DOFLER_ADDRESS "" | ||
|
||
RUN apk add --update --no-cache git build-base libpcap libpcap-dev \ | ||
&& git clone https://github.com/bldewolf/driftnet.git /driftnet \ | ||
&& cd /driftnet \ | ||
&& sed -i 's/#CFLAGS += -DNO_DISPLAY_WINDOW/CFLAGS += -DNO_DISPLAY_WINDOW/g' Makefile \ | ||
&& sed -i 's/CFLAGS += `pkg-config --cflags gtk+-2.0` `pkg-config --cflags libpng`//g' Makefile \ | ||
&& sed -i 's/LDLIBS += -ljpeg -lgif `pkg-config --libs gtk+-2.0` `pkg-config --libs libpng`//g' Makefile \ | ||
&& make \ | ||
&& cp driftnet /usr/bin \ | ||
&& cd /app \ | ||
&& npm install \ | ||
&& mkdir -p /images \ | ||
&& rm -rf /driftnet \ | ||
&& apk del --no-cache git build-base | ||
|
||
# install the dependencies from apk, pull in driftnet from the builder image, | ||
# and then pull in the parser code. | ||
RUN apk -U add --no-cache libpcap | ||
COPY --from=builder /driftnet/driftnet /usr/bin/ | ||
COPY app /opt/app | ||
|
||
# Install the needed dependencies from NPM | ||
WORKDIR /opt/app | ||
RUN npm install . | ||
|
||
VOLUME /images | ||
|
||
CMD ["node", "/opt/app/index.js"] |