An Introduction to Footloose: Containers that look like VMs
Footloose creates containers that look like virtual machines. Those containers run systemd as PID 1 and a ssh daemon that can be used to log into the container. Such "machines" behave very much like a VM, it's even possible to run dockerd in them.
In a recent Weave Online User Group, Damien Lespiau (@_damien_), a Weaveworks engineer walked us through a demonstration of Footloose, a recently released open source project.
What is Footloose?
Footloose creates containers that look like virtual machines. The containers all run systemd as PID 1 and also include an SSH daemon that allows you to log into them. Footloose containers run and behave like a VM. It's even possible to run a Docker daemon inside of them.
The easiest way to think about Footloose is as a Vagrant equivalent, but with containers instead. Vagrant is a tool that was created quite some time ago by Hashicorp to launch VMs onto developer's laptops, and create sandbox environments that can be used for testing or other experimental projects. Footloose has similar goals, but instead of launching VMs, it launches containers that behave exactly like VMs. Once running, they can be used for a variety of tasks; typically you'd use them like any other virtual machine, taking advantage of their fast boot times; or perhaps, you need to launch several VMs all at once for an intensive testing project.
After the Footloose binaries have either been built or downloaded for your OS, running the command `footloose config create` creates a YAML file that is used by any subsequent Footloose commands. Below is a typical YAML created by Footloose:
See Footloose in action
What can you do with the VMs?
After launching a container VM, SSH onto it and take a look around. It looks exactly like a virtual machine, with an init system, as well as systemd. And since it’s like a regular VM, you can install any other packages that you need.
The main uses for Footloose are:
- Running different OS’ on your local machine - For example, in the demo, Damien’s laptop was running Ubuntu, but the container VMs were running Fedora. You can create custom base images to use in your container VMs. In this way you are able to run a number of simultaneous tests on different OS’.
- Run Docker inside the VMs - You can also run `dockerd` inside the VMs. With Dockerd running in your VMs, a Kubernetes cluster can be installed on top of that. The main reason we built footloose was to be able to test our Kubernetes installer, kubeadm, on a number of different OS’ in Kubernetes all at once.
- Run Apache - Create a base image with apache included and which exposes an open port like 80 or 443.
- Provision machines with Ansible - install ansible to the VMs and run it from there to provision extra machines.
- DNS resolution and isolation - With a user-defined network that enables DNS name resolution of the container names, you can talk to each container of the cluster with just the hostname.
Many more examples can be found in the Footloose docs.
View the discussion and demonstration in its entirety here: