Containers are the new frontier of application packaging, as witnessed by the rise of Docker. Docker popularized the idea of using containers, combining simple command line tooling with a central image repository for easy sharing of images. Now that containers are moving past MVP, some of the limitations of the Docker model are becoming more apparent, and there are a number of projects that are trying to fix some of Docker’s design mistakes.
CoreOS announced rkt (pronounced rocket) last year. Rkt is creating a workable and open specification for a container image format, called the App Container Image or ACI. rkt is an implementation of a whole family of these open specifications, but I’m starting my investigations at the beginning!
ACI is deliberately minimal: it is a tarball, with a manifest JSON file at the root (
/manifest) and a filesystem
tree for the container (
/rootfs). There are a lot more features, but today I wanted to start by figuring out an easy
way to build these images.
The “absolute right way” to build a container image is to compile exactly what you need, and copy just that into a tarball. But this process is fairly hard, and essentially amounts to maintaining your own (special-purpose) distro. (Which does suggest that it would be interesting to try this with gentoo, but I digress…)
An alternative is to leverage the work done by the distros, in my case Debian Jessie packages. packages2aci is a simple “tool” I created (just a batchfile really) which can create an ACI based on a list of packages and a manifest.
packages2aci goes through a list of packages, and individually downloads them (using
apt-get download), expands them using
and then calls
actool to build the manifest. Incredibly simple, apart from the fact that you have to specify each package
individually (it doesn’t do dependency analysis). This is both annoying (busywork) and handy (sometimes you know that you don’t
actually need some library).
With packages2aci, it is very easy to build simple ACI images from your OS packages, and start running rkt images. There’s an
example for Java 7, which just runs
java -version, which isn’t very useful but is a good first step. Next time, I’ll post about why I want a Java base image!