Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You can create a bridge user-defined network and take advantage of this awesome new feature. https://docs.docker.com/engine/userguide/networking/dockerne...


But doesn't user-defined networks create new bridges? I want use my already existing network. Over SSH, I executed the following and my connection is lost, because my eth1 and probably newly created bridge is in conflict over routing table.

> docker network create --gateway 172.16.0.1 --subnet 172.16.0.0/21 mynet


Yes. `--ip` is supported only on user-defined networks. That is because, the subnet for the default bridge (docker0) can be changed (via --bip) or user can change the user-specified default bridge (via -b) on daemon restarts. If the subnet backed by these default bridge's change, then the container with a assigned `--ip` will fail as well.

Having said that, with Docker 1.9 & above, IP address management and Network plumbing are separate concerns and both are pluggable. One could implement a network plugin with any logic and continue to enjoy all the built-in IPAM features (including --ip). Hence, if you have a specific network plumbing requirement, you could easily spin up a plugin (or use one of the many network plugins that are available out there).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: