为docker配置固定ip
docker默认使用bridge模式,通过网桥连接到宿主机,而容器内部的ip则从网桥所在的ip段取未用的ip。这样做一个不方便的地方在于容器内部的ip不是固定的,想要连接容器时只能通过映射到宿主机的端口,因而有很多项目使用overlay来为docker提供网络的配置,比如Pipework、Flannel、Kubernetes、Weave、opencontrail等。 想要使用overlay来为docker配置网络,需要首先了解下docker的网络模式: --net=bridge— The default action, that connects the container to the Docker bridge as described above. --net=host— Tells Docker to skip placing the container inside of a separate network stack. In essence, this choice tells Docker tonot containerize the container's netwo...


