docker运行中的服务映射端口
docker inspect -f='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' [容器name]
获取容器的IP
iptables -t nat -A DOCKER -p tcp --dport 8001 -j DNAT --to-destination 172.17.0.19:8000
IP是有上面一步查出来的、将外部端口8001映射到容器端口8000
iptables -nL
查看端口映射情况
但自己操作后、通过命令查看并没法发现端口映射成功