Skip to content

Instantly share code, notes, and snippets.

@bedilbek
Last active April 19, 2024 09:14
Show Gist options
  • Select an option

  • Save bedilbek/7233b6e6b684b68e35f20017a00264ac to your computer and use it in GitHub Desktop.

Select an option

Save bedilbek/7233b6e6b684b68e35f20017a00264ac to your computer and use it in GitHub Desktop.
tshark Docker Image
FROM ubuntu:22.04 as builder
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates wget xz-utils build-essential cmake \
libglib2.0-dev libgcrypt20-dev flex \
yacc bison byacc libpcap-dev libssh-dev \
libsystemd-dev libc-ares-dev libspeexdsp-dev
RUN wget https://2.na.dl.wireshark.org/src/wireshark-4.2.4.tar.xz -O /tmp/wireshark-4.2.4.tar.xz \
&& tar -xvf /tmp/wireshark-4.2.4.tar.xz -C /tmp \
&& cd /tmp/wireshark-4.2.4 \
&& cmake -S . -B build -DBUILD_wireshark=OFF -DBUILD_dftest=OFF -DCMAKE_INSTALL_PREFIX=/tmp/wireshark-4.2.4/install \
&& cmake --build build --target install -- -j$(nproc)
FROM ubuntu:22.04 as runtime
ENV PATH=$PATH:/tmp/wireshark-4.2.4/install/bin
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/tmp/wireshark-4.2.4/install/lib
COPY --from=builder /tmp/wireshark-4.2.4/install /tmp/wireshark-4.2.4/install
COPY --from=builder /usr/lib/x86_64-linux-gnu/libpcap.so /usr/lib/x86_64-linux-gnu/libpcap.so.0.8
COPY --from=builder /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7200.4 /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
COPY --from=builder /usr/lib/x86_64-linux-gnu/libcares.so.2.5.1 /usr/lib/x86_64-linux-gnu/libcares.so.2
COPY --from=builder /usr/lib/x86_64-linux-gnu/libdbus-1.so.3.19.13 /usr/lib/x86_64-linux-gnu/libdbus-1.so.3
COPY --from=builder /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0.7200.4 /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0
COPY --from=builder /usr/lib/x86_64-linux-gnu/libssh.so.4.8.7 /usr/lib/x86_64-linux-gnu/libssh.so.4
ENTRYPOINT ["tshark"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment