https://bbs.csdn.net/topics/396176016?list=72195043
https://blog.csdn.net/heian_99/article/details/104914945
https://www.cnblogs.com/windyet/articles/10139739.html
https://blog.csdn.net/mygirle/article/details/108667030
https://blog.csdn.net/qq_45300786/article/details/107583032
使用docker network命令来查看所有网络:docker network ls
查看 docker network inspect bridge
通过-p指定 一个静态IP: docker run -it --network=my_net2 --ip 172.22.16.8 busybox
可见同一网络中的容器、网关之间都是可以通信的
1.ipconfig docker 虚拟网卡 :10.0.75.2 172.17.52.97
2.查看容器信息:docker ps -a
3.查看IP地址 也可以直接通过用 远程执行命令也可以(Centos7);docker exec -it ID/NAMES ip addr
docker exec -it 69dc17023025 ip addr (127.0.0.1/8) docker exec -it 11234874b8a5 ip addr
容器ip地址为自动分配 :172.17.0.2 127.0.0.1/8
4.route print
5.ping 172.17.0.2 ping 127.0.0.1
6.打开docker查看docker 的ip地址 : 255.255.255.0 10.0.75.2 192.168.65.0/28
暴露给宿主机的为10.0.75.1 192.168.65.0/28
7.添加路由
route -p add 172.17.0.0 MASK 255.255.255.0 10.0.75.2
route DELETE 172.18.0.0
ping 172.18.0.3
https://jingyan.baidu.com/article/95c9d20d61bc1dec4f756156.html
指定主机docker run -itd --name test1 --network bridge --ip 172.17.0.10 centos:latest/bin/bash
docker run -itd --name grafana --network host centos:latest/bin/bash
docker run --name grafana --network host /bin/bash
--network=host
docker run -v F:/test:/sitespeed.io sitespeedio/sitespeed.io https://cdp-dev.xiaoshouyi.com -n 1
进入docker exec -i -t system32_grafana_1 /bin/bash
docker exec -u root -it system32_grafana_1 /bin/bash
配置host
启动容器的时候加上“--add-host”把hosts配置上:81.69.154.92 cdph5-dev.xiaoshouyi.com
# docker run --add-host=www.baidu.com:127.0.0.1xxx -it /bin/bash
docker run --add-host=cdph5-dev.xiaoshouyi.com:81.69.154.92 system32_grafana_1 -it /bin/bash
docker run -v F:/test:/sitespeed.io sitespeedio/sitespeed.io https://www.baidu.com -n 1 --network host
(2)docker start 容器ID docker start 45faabe398d7
(3)进入容器:docker exec -i -t naughty_ardinghelli /bin/bash
docker exec -i -t my_nginx /bin/bash
docker run -v -d F:/test:/sitespeed.io sitespeedio/sitespeed.io https://www.baidu.com -n 1 /bin/bash
docker run -v F:/test:/sitespeed.io sitespeedio/sitespeed.io https://www.baidu.com -n 1 tail -f /dev/null
docker run -i 11233e5c89eb
docker run -dit 11233e5c89eb