Jérôme Petazzoni

Unionize: network superpowers for your docker containers

Some people asked for special network setups with docker containers:

  • Bryan Berry wants to run Cassandra nodes and specify their IP addresses [1];
  • Matt Parlane wants to expose arbitrary IP addresses to docker containers [2];
  • Jeremy Grosser wants to plumb docker containers with openvswitch;
  • I personally want to play with doozerd[3], 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[4].

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.

Sample use:

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 [4].

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.

[1] https://groups.google.com/forum/#!topic/docker-club/okJ0HTU1Vkw
[2] https://groups.google.com/forum/#!topic/docker-club/ZlMDFLCe_As
[3] https://github.com/ha/doozerd
[4] https://gist.github.com/jpetazzo/5493295

About Jérôme Petazzoni

 

Jérôme is a senior engineer at dotCloud, where he rotates between Ops, Support and Evangelist duties and has earned the nickname of “master Yoda”. In a previous life he built and operated large scale Xen hosting back when EC2 was just the name of a plane, supervized the deployment of fiber interconnects through the French subway, built a specialized GIS to visualize fiber infrastructure, specialized in commando deployments of large-scale computer systems in bandwidth-constrained environments such as conference centers, and various other feats of technical wizardry. He cares for the servers powering dotCloud, helps our users feel at home on the platform, and documents the many ways to use dotCloud in articles, tutorials and sample applications. He’s also an avid dotCloud power user who has deployed just about anything on dotCloud – look for one of his many custom services on our Github repository.

Connect with Jérôme on Twitter! @jpetazzo

, , ,

Jérôme Petazzoni

Unionize: network superpowers for your docker containers


Leave a Reply

Get the Latest Docker News by Email

Docker Weekly is a newsletter with the latest content on Docker and the agenda for the upcoming weeks.