How to install tshark on Docker?

I want to install tshark on ubuntu17.04 on Docker for Mac with Dockerfile.
I am using docker-compose

In apt install tshark, there is a following prompt.
The prompt stopping install despite I typed yes.

  • Docker Registry 2.0 with Amazon S3 and TLS setup
  • Docker reuse port in a consul TCP health check cycle
  • Mount Volume to Host
  • Apache Mesos's Docker Containerizer
  • Running Couchbase under GCE Docker and getting error about max number of files
  • Add to container's /etc/hosts using Fig?
  • How to install tshark in Dockerfile?

    Dumpcap can be installed in a way that allows members of the "wireshark" system
    group to capture packets. This is recommended over the alternative of running
    Wireshark/Tshark directly as root, because less of the code will run with
    elevated privileges.
    
    For more detailed information please see
    /usr/share/doc/wireshark-common/README.Debian.
    
    Enabling this feature may be a security risk, so it is disabled by default. If
    in doubt, it is suggested to leave it disabled.
    
    Should non-superusers be able to capture packets? [yes/no] yes
    

  • Symfony - Unknown MySQL server host when using command line
  • How can I use the docker daemon from a container running on a host provisioned by Docker Machine?
  • Elastic Beanstalk CLI - Not replacing instance on deploy
  • Containerization of OpenStack services with Kubernetes?
  • docker ubuntu image uname result
  • How to tag a docker container?
  • One Solution collect form web for “How to install tshark on Docker?”

    First, you generally have (to avoid having to type ‘yes’):

    RUN apt install -yq xxx
    

    Second:

    • you can check out this tshark image, which does install dumcap; by compiling wireshark, which produced dumpcap.
    • the alternative (no compilation, only install) is this image

    The install command becomes in that last case:

    # Install build wireshark, need to run as root RUN apt-get update && \
        apt-get install -y wireshark && \
        groupadd wireshark && \
        usermod -aG wireshark developer && \
        setcap 'CAP_NET_RAW+eip CAP_NET_ADMIN+eip' /usr/bin/dumpcap && \
        chgrp wireshark /usr/bin/dumpcap && \
        chmod 750 /usr/bin/dumpcap
    
    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.