运维-docker-查看容器IP

2 阅读1分钟

方法一:容器里面安装IP查看命令

容器内安装命令
yum -y install iproute

容器内使用命令查看IP
ip addr shou

ip a s

方法二:通过检查容器信息查看IP

docker inspect [运行中的容器别名]

image.png

方法三:在容器外指定容器执行命令

前提是容器运行中,且安装了ip a s命令

docker exec c2 ip a s