Skip to content

Commit

Permalink
Shrink container by 60%
Browse files Browse the repository at this point in the history
Signed-off-by: Lorenzo Mangani <[email protected]>
  • Loading branch information
lmangani authored Nov 14, 2023
1 parent dcd2bb9 commit ce3204c
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down

0 comments on commit ce3204c

Please sign in to comment.