首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在Docker上安装tshark?

如何在Docker上安装tshark?
EN

Stack Overflow用户
提问于 2017-04-03 12:32:45
回答 2查看 5.5K关注 0票数 7

我想在带有Dockerfile的Docker for Mac上的ubuntu17.04上安装tshark。我正在使用docker-compose

apt install tshark中,会出现以下提示。

尽管我键入了yes,但系统仍提示停止安装。

如何在Dockerfile中安装tshark?

代码语言:javascript
复制
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
EN

回答 2

Stack Overflow用户

发布于 2017-08-17 08:45:07

代码语言:javascript
复制
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y tshark

无需用户交互即可安装。

票数 10
EN

Stack Overflow用户

发布于 2017-04-03 12:38:40

首先,您通常需要(为了避免必须键入“yes”):

代码语言:javascript
复制
RUN apt install -yq xxx

第二:

  • 你可以查看这个tshark image,它确实安装了dumcap;通过编译wireshark,它产生了dumpcap。
  • 另一种选择(不编译,只安装)是dumcap

在最后一种情况下,install命令变为:

代码语言:javascript
复制
# 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
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43176520

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档