小编era*_*ran的帖子

管道 docker 将 -f 记录到 jq

我正在尝试将 json 日志从 docker 传输到jq. 如果我使用它,它工作正常:

docker logs container_id 2>&1 | jq '.'
Run Code Online (Sandbox Code Playgroud)

但是,如果我试图追踪它,它就会卡住。

docker logs -f container_id 2>&1 | jq '.'
Run Code Online (Sandbox Code Playgroud)

虽然尾随本身确实有效:

docker logs -f container_id 2>&1
Run Code Online (Sandbox Code Playgroud)

我在这里缺少什么?

docker

8
推荐指数
1
解决办法
1477
查看次数

在centOS docker容器内运行wireshark

我使用yum( RUN yum install -y wireshark wireshark-qt) 安装了wireshark,但当我通过 ssh 进入容器时无法运行它。

# tshark
tshark: Couldn't run /usr/sbin/dumpcap in child process: Operation not permitted
Are you a member of the 'wireshark' group? Try running
'usermod -a -G wireshark _your_username_' as root.
Run Code Online (Sandbox Code Playgroud)

我尝试运行usermod -a -G wireshark root(当我 ssh 进入机器时,它是以 root 身份运行的)。这没有帮助。

也尝试过su -c '/usr/sbin/tshark'没有成功。

我应该怎么办?

centos wireshark docker

6
推荐指数
2
解决办法
5368
查看次数

标签 统计

docker ×2

centos ×1

wireshark ×1