From 27f89d7ed601797314170c618a419310e0c41b20 Mon Sep 17 00:00:00 2001 From: Andrey Arapov Date: Mon, 23 Jan 2017 23:48:04 +0100 Subject: [PATCH] add wireshark --- wireshark/Dockerfile | 32 ++++++++++++++++++++++++++++++++ wireshark/docker-compose.yml | 16 ++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 wireshark/Dockerfile create mode 100644 wireshark/docker-compose.yml diff --git a/wireshark/Dockerfile b/wireshark/Dockerfile new file mode 100644 index 0000000..f577a6e --- /dev/null +++ b/wireshark/Dockerfile @@ -0,0 +1,32 @@ +# Run Wireshark in a container +FROM ubuntu:xenial +MAINTAINER Andrey Arapov + +# To avoid problems with Dialog and curses wizards +ENV DEBIAN_FRONTEND noninteractive + +RUN apt-get update && \ + apt-get -y --no-install-recommends install \ + ca-certificates wireshark && \ + rm -rf -- /var/lib/apt/lists + +ENV USER user +ENV UID 1000 +ENV HOME /home/$USER + +ENV LC_ALL C.UTF-8 + +RUN useradd -u $UID -m -d $HOME -s /usr/sbin/nologin $USER + +# Allow a non-privileged user to use the wireshark +# https://wiki.wireshark.org/CaptureSetup/CapturePrivileges +RUN setcap 'CAP_NET_RAW+eip CAP_NET_ADMIN+eip' /usr/bin/dumpcap + +USER $USER +WORKDIR $HOME +ENTRYPOINT [ "wireshark" ] + +# Just an alternative way to start wireshark +# RUN echo "$USER ALL=NOPASSWD:SETENV:/usr/bin/wireshark" | tee /etc/sudoers.d/$USER +# ENTRYPOINT [ "sudo", "-E", "wireshark" ] +# xhost +; wireshark; xhost - diff --git a/wireshark/docker-compose.yml b/wireshark/docker-compose.yml new file mode 100644 index 0000000..e45f8e1 --- /dev/null +++ b/wireshark/docker-compose.yml @@ -0,0 +1,16 @@ +version: '2' + +services: + wireshark: + image: andrey01/wireshark + network_mode: host + volumes: + - /tmp/.X11-unix:/tmp/.X11-unix:ro + - $HOME/Downloads:/home/user/Downloads:ro + - /etc/localtime:/etc/localtime:ro + environment: + - DISPLAY=unix$DISPLAY + # https://forum.qt.io/topic/55144/qxcbconnection-xcb-error-qwarning + - QT_DEVICE_PIXEL_RATIO=2 + cap_add: + - NET_ADMIN