dockerdockerfilewiresharkdpkgnon-interactive

Doing dpkg-reconfigure wireshark-common inside of a Dockerfile


How do you do dpkg-reconfigure wireshark-common inside of a Dockerfile?

My Docker file contains: RUN apt-get install wireshark --yes

But the --yes does not effect the dpkg-reconfigure wireshark-common step so it is not obvious to me how to answer Yes or even No to the on screen question Should non-superusers be able to capture packets?.


Solution

  • Try using the yes command.

    RUN yes | dpkg-reconfigure wireshark-common
    

    Another try you can do is:

    RUN echo "y" | dpkg-reconfigure wireshark-common
    

    Not sure now what is wireshark asking for on dpkg-reconfigure... but using this technique you can send a "y" or a "1" or whatever you need.

    Another possible solution based on your comments here:

    RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y wireshark
    

    With this last one, you'll skip any interactive post-install configuration steps.