问题:最近学习狂神的docker,34节,网络详解。下载tomcat镜像并启动成功。如图
在使用命令: docker exec -it tomcat01 ip addr
查看容器ip地址时报错:OCI runtime exec failed: exec failed: unable to start container process: exec: "ip": executable file not found in $PATH: unknown
解决方案:安装工具 iproute2
1.进入容器: docker exec -it tomcat01 /bin/bash
2.在容器内部安装iproute: apt install -y iproute2
运行结果如图:
最终结果:成功运行命令:docker exec -it tomcat01 ip addr