查看docker的IP地址

容器内部
cat /etc/hosts
---------------------------------
宿主机
1.docker ps
CONTAINER ID        IMAGE                                COMMAND                  CREATED             STATUS              PORTS                                     
2a0fddf3b486        mysql:latest                         "docker-entrypoint.sh"   3 weeks ago         Up 2 days           0.0.0.0:3306->3306/tcp 
2.docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' 2a0fddf3b486