网站首页 文章专栏 查看docker 容器内部 tcp 连接
查看docker 容器内部 tcp 连接
编辑时间:2021年7月16日 18:55 作者:赵彦昌 浏览量:1879

dd






#!/bin/bash

if [ x"$1" == x"" ]; then
        echo "缺少参数1 <grep key>"
fi

for d_id in `docker ps | awk '{print $1}'`
do
        echo ${d_id}
        d_pid=`docker inspect -f '{{.State.Pid}}' ${d_id} `
        if [ x"${d_pid}" == x"" ]; then
                continue
        fi
        nsenter -t ${d_pid} -n netstat | grep $1
done





dd


来说两句吧
最新评论