Some people asked for special network setups with docker containers:
- Bryan Berry wants to run Cassandra nodes and specify their IP addresses ;
- Matt Parlane wants to expose arbitrary IP addresses to docker containers ;
- Jeremy Grosser wants to plumb docker containers with openvswitch;
- I personally want to play with doozerd, but it requires UDP, which is not yet available in docker.
Generally speaking, specifying IP addresses for containers obviously leads to setups which are not reproducible. But it is also obviously very useful for many test setups.
To encourage people to use docker in those scenarios (rather than switching to plain LXC!), let me introduce: unionize.
- is a simple bash script, using basic tools (brctl, ip, ifconfig)
- lets you create private networks for your containers
- lets you connect containers with the outside world, in arbitrary topologies.
unionize.sh br1 $(docker run -d apache /usr/sbin/httpd) 192.168.1.1 $(docker run -d mysql /usr/sbin/mysqld_safe) 192.168.1.2
More examples are show in .
Feedback is welcome! If this solves at least one person’s problems, I’m willing to propose that as a contrib script in the official repo.