这篇文章讲一下如何查看docker中的ip地址
前提
1、容器必须是启动状态
2、需要进入容器中,进入docker容易的方法请点这个 http://www.freetechs.cn/archives/42
执行下面命令,其中有容器的ID的ip就是
cat /etc/hosts
root@90b2ed24a5e6:/app# cat /etc/hosts
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
172.17.0.2 90b2ed24a5e6
当前IP 172.17.0.2