我正在尝试将 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)
我在这里缺少什么?
我使用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'没有成功。
我应该怎么办?