add wireshark

This commit is contained in:
Andy 2017-01-23 23:48:04 +01:00
parent d249f6b0a6
commit 27f89d7ed6
Signed by: arno
GPG Key ID: 368DDA2E9A471EAC
2 changed files with 48 additions and 0 deletions

32
wireshark/Dockerfile Normal file
View File

@ -0,0 +1,32 @@
# Run Wireshark in a container
FROM ubuntu:xenial
MAINTAINER Andrey Arapov <andrey.arapov@nixaid.com>
# 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 -

View File

@ -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