diff --git a/Dockerfile b/Dockerfile index 96dc876..b1b4858 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,10 @@ FROM node:20-bookworm as intermediate -ENV serial 202098761 - RUN apt-get update && apt-get install -y \ - git make python3 cmake flex bison libglib2.0-dev libgcrypt20-dev libspeex-dev libspeexdsp-dev libc-ares-dev \ + git sed wget unzip make python3 cmake flex bison libglib2.0-dev libgcrypt20-dev libspeex-dev libspeexdsp-dev libc-ares-dev \ && rm -rf /var/lib/apt/lists/* -RUN mkdir -p /out -RUN mkdir -p /usr/src -RUN mkdir -p /var/run - +RUN mkdir -p /out /usr/src /var/run WORKDIR /usr/src RUN git clone --depth=1 https://github.com/qxip/node-webshark.git /usr/src/node-webshark @@ -18,24 +13,34 @@ RUN git clone --depth=1 https://gitlab.com/wireshark/wireshark.git /usr/src/wire WORKDIR /usr/src/wireshark RUN ../node-webshark/sharkd/build.sh +WORKDIR /usr/src +RUN mkdir web \ + && cd web \ + && wget github.com/qxip/webshark-ui/releases/latest/download/latest.zip \ + && unzip latest.zip \ + && rm -rf latest.zip \ + && sed -i 's|href="/"|href="/webshark/"|g' index.html + -FROM node:20-bookworm +FROM node:20-bookworm-slim RUN apt update \ - && apt install -y git libglib2.0-0 speex libspeex1 libspeexdsp1 libc-ares2 \ + && apt install -y git libglib2.0-0 speex libspeex1 libspeexdsp1 libc-ares2 libxml2 \ && rm -rf /var/lib/apt/lists/* -RUN mkdir -p /captures -VOLUME /captures +RUN mkdir -p /captures /usr/local/bin /usr/local/share/wireshark/ -COPY --from=intermediate /out /out -RUN cd / && tar zxvf /out/sharkd.tar.gz && rm -rf /out/sharkd.tar.gz +COPY --from=intermediate /usr/src/wireshark/build/run/sharkd /usr/local/bin/sharkd +COPY --from=intermediate /usr/src/wireshark/build/run/colorfilters /usr/local/share/wireshark/colorfilters ENV CAPTURES_PATH=/captures/ +ENV SHARKD_SOCKET=/captures/sharkd.sock COPY --chown=node . /usr/src/node-webshark +COPY --from=intermediate /usr/src/web /usr/src/node-webshark/web USER node +VOLUME /captures WORKDIR /usr/src/node-webshark/api RUN npm install