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

I love the ability of specifying IPs but, I just want to give static IPs to my containers from my private network, and attaching to my already existing bridge does not work, I started daemon as following but no help

> ./docker-1.10.0 daemon -b br0 --default-gateway 172.16.0.1

> ./docker-1.10.0 run --ip 172.16.0.130 -ti ubuntu bash docker: Error response from daemon: User specified IP address is supported on user defined networks only.

But my KVM vms work fine with that bridged network. I know I could just port forward but I don't want to, yes It seems I am treating my containers as VMs, but it worked so fine in default LXC, we could even use Open vSwitch bridge for advanced topologies.



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).




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: