Docker has grown wildly in the last few years. It’s gone from a fledgling startup to a billion-dollar company, and now it’s got the attention of the enterprise. A number of changes have happened at Docker too – there’s been a leadership transition as well as Docker giving many of its core components over to the open source community to be managed there. All this change has set the stage for the next chapter in Docker history. Docker at DockerCon 2017 announced a new initiative that is aimed to take containers to the next frontier through the Moby Project.

The Moby Project has bold ambitions. It seeks to expand containers to include not only applications, but also core system components as well on an operating system. Docker says, “Moby is a framework to assemble specialized container systems. It has a library of containerized components and a framework for assembling these components into a standalone container platform.” Traditionally, containers were subsequent to an operating system – it would boot, load the container engine, then load containers that hosted applications like databases, message queues, and web servers. Moby intends to containerize things like DHCP servers, DNS servers, and so on such that they too can be pulled and plugged in much the same way of traditional containers to build custom operating systems.

LinuxKit fits into the Moby Project as one of the containerized components, but it’s a special case because it’s the kernel of the operating systems. Of LinuxKit, Docker says, “LinuxKit is a toolkit for building minimal Linux distributions. It uses Moby to build the distro images and the LinuxKit tool to run them. It is designed to be secure by default.” The intention behind Moby and its use of LinuxKit is to build a distro that has “just enough Linux” to accomplish a task and do it in a way that is secure.

In the end, Docker wants to use Moby and LinuxKit to feed the Docker CE and Docker EE environments. The imperative then for Docker is to get it right. To date, the project is still in its infancy, but like most things it will mature as will the tooling. But for now, here’s a quick start guide that will get you up and running with Moby.

Setup an Ubuntu VM with 16.04 or 16.10 – either one will work. Logon to the VM through a terminal session or SSH session. You’ll need to be root on the Ubuntu install. You can get root access by typing in:

sudo -i

Now that you are root, create a shell script from the following code. You can do this by creating a file with Unix line endings on Windows in a text editor and upload it, or simply use a text editor in a ssh terminal such as nano and paste it in.

#!/bin/sh
#Install dependencies for the build
apt-get update
apt-get install apt-transport-https  ca-certificates curl software-properties-common build-essential git

# Install Docker
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - && 
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu  $(lsb_release -cs) stable"
apt-get update
apt-get install docker-ce

# Install Go
wget https://storage.googleapis.com/golang/go1.8.1.linux-amd64.tar.gz
tar xvf go1.8.1.linux-amd64.tar.gz
chown -R root:root ./go
sudo mv go /usr/local
echo "export GOPATH=$HOME/work" >> ~/.profile
echo "export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin" >> ~/.profile
source ~/.profile

# Install Moby
go get -u github.com/moby/tool/cmd/moby

# Install Linux Kit
git clone https://github.com/linuxkit/linuxkit
cd ./linuxkit
make
make install

Once the file is created, save it then run it. This will install all of the dependencies, Docker, Moby and Linux Kit.

sh /path/to/yourfile.sh

Change directories to the linuxkit directory, which is probably /root/linuxkit, then build the image.

cd ~/linuxkit

Now, build the image.

moby build linuxkit.yml

Now, run the image. The following command will download the Qemu emulator to bootstrap the image for testing. You can poke around in the image and see what is installed and the like. The image is built using the linuxkit.yml file which contains the instructions for making the image similar to how docker-compose.yml files work.

linuxkit run linuxkit

Once you’re done playing with it, you can type in halt to exit the image.

halt

That’s it. You can explorer more with Moby over at their GitHub repo or through the project’s home page. The documentation is still a bit sparse. In time, this tech will hopefully mature as will the documentation and tooling around it.

To clean up, simply delete the VM you created if you don’t want to explorer Moby any further.