Jérôme Petazzoni

Create lightweight Docker containers with Buildroot

Highlights of this article (TL,DR): we’ll show how to use buildroot to create a basic but fully functional container using less than 4 MB of disk space (uncompressed). Then we will apply the same technique to obtain a PostgreSQL image which fits in less than 20 MB (not including your databases, of course). You can play with those containers at once if you want. Just run “docker run jpetazzo/pglite”, and within seconds, you will have a PostgreSQL server running on your machine! I like containers, because they are lighter than virtual machines. This means that they will use less disk space, less memory, and ultimately be cheaper and faster than their heavier counterparts. They also boot much faster. Great. But how “lightweight” is “lightweight”? I wanted to know. We all wanted to know. We already have a small image, docker-ut, Continue reading…

Jérôme Petazzoni

BTRFS support for docker

Hi all, A couple of weeks ago, at the end of the docker hackday, I demo-ed dockerlite[1], a re-implementation of docker with posix shell scripts, and using BTRFS instead of AUFS for images and containers storage. Dockerlite proved itself to be an incredibly useful sandbox to test new concepts. The first result is the implementation of basic docker operations using BTRFS instead of AUFS. Instead of using AUFS layers, it uses BTRFS subvolumes and snapshots. It is very efficient (since it doesn’t have to perform copy-up like AUFS) and down the road should be a more viable option than AUFS.

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: Continue reading…

Jérôme Petazzoni

Docker containers can haz networking now!

TL,DR: The following command will allocate a random port on your machine, and map it to port 1234 inside a container: docker run -p 1234 base — nc -l 1234 Use docker inspect (and look under NetworkSettings) to see which random port was allocated. Good news, everyone! Networking support has been merged. This means that your containers can now talk to the outside world (duh!), and the outside world can talk to them as well.

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.