Docker Friendly OS

September 21, 2018

I had a hard time in deciding the title for this article, Docker tends to work without any problem on all major Linux flavors, i.e all OSes are generally Docker friendly. Docker runs by creating a virtual environment for running your applications that is portable and runs without any changes from server to server. These virtual environments (aka containers) do not have to worry about the underlying OS capabilities or how dependencies are handled. (For a more detailed introduction to Docker, feel free take a look at my Docker 101 post.)

This raises the question, why do you need an OS that is built specifically for hosting Docker containers. As long as your kernel supports Docker, setting up containers should be easy. Yes, that’s true. However, there are advantages of using a docker friendly OS.

  • Updates are deemed “transactional”, which means you can roll back an update if something fails
  • In most cases, these OSes have different package managers (not the usual yum/apt) which makes packages available in a quicker, simpler way
  • There is better security as there are a variety of isolation mechanisms
  • Docker friendly OSes have a very small footprint, which gives your container more working space.

Boot2Docker

From the team’s GitHub page, this OS is specifically designed to run Docker containers. It is 45MB in size and boots quickly. Due to the small footprint, it runs completely from RAM. Though mentioned as an OS in “maintenance mode” with recommendations to use official Docker desktop builds, this OS is great for creating Virtual Machines (for e.g. via VirtualBox) and start running with Docker. The OS features a persistent disk location that allows you to store data between runs and is based on Tiny Core Linux

RancherOS

RancherOS is a simplified Linux distribution that allows running containers in a scalable manner across a variety of environments. All components of the OS are docker containers (running as part of the main System Docker instance), which means that the OS only contains a minimum amount of software required to run Docker. Anything additional can be pulled from Docker. This also means that you no longer have to contend with updating and patching the core operating system.

 

How it works

 

(How RancherOS works, from the RancherOS Github page)

The OS footprint is reduced by more than 3 times resulting in a quick and fast OS. System services are defined by Docker compose and automatically configured using cloud-init (to run specific modules during booting)

CoreOS

The team at CoreOS states that it is “A lightweight Linux operating system designed for clustered deployments providing automation, security, and scalability for your most critical applications”

CoreOS is based on Chromium OS and is designed to simplify deployment on your clusters. You can containerize your web apps, microservices and easily deploy them across the providers of your choice. Security updates are automatically applied to the system without requiring admin intervention. Like the other OSes we looked at so far, CoreOS contains only the basics and each container running on CoreOS uses the libraries and components it requires allowing you to run containers with different component versions (for e.g., different versions of Python).

CoreOS is now part of the RHEL family.

Snappy Ubuntu Core

When it comes to Linux Distributions, no list would be complete without Canonical’s presence. Ubuntu Core is a minimal Ubuntu version that is designed to be lightweight and run on embedded and IoT devices. Rather than using the traditional apt method to deploy app packages, Ubuntu Core uses secure, remotely upgradable packages called snaps (therefore the name Snappy Ubuntu Core).

To deploy your first Snappy installation, you would need a Ubuntu SSO account. This is because packages are designed to be upgraded remotely. Applications are isolated and secure using AppArmor. Updates (both to apps and the Snappy Core) are transactional, which means you can rollback if something breaks.

Developing snaps is easy and Ubuntu provides excellent tutorials on how to publish and distribute your apps. Dockerized applications can be redistributed as “snaps” making it easy to push updates to remote devices

Project Atomic

The last OS in our list is also a RedHat sponsored project. Project Atomic aims to provide immutable infrastructure for deploying to any number of servers. Consisting of an Atomic Host (available as Fedora Atomic Host, CentOS Atomic Host, and Red Hat Atomic Host editions) and container Tools.

Replacing yum, is rpm-ostree that used to manage the baseOS rpm in a git like fashion. Using container tools such as Buildah you can create images which can then be shipped via skopeo (another tool from the Project Atomic team). There are a variety of container specific tools developed by this team which will help you install, run and manage containers or create sandboxes for development.

 

With Docker (and container technology) becoming the focus of enterprises and projects, there are active groups that are working to make Docker run on a plethora of devices. An enterprising user worked to update the ReadyNAS OS (that runs Netgear’s Network Attached Storage devices) to run Docker containers. Sweet, right? You could run your own Nextcloud docker image from the NAS.

 


Ramesh Vishveshwar
Ramesh Vishveshwar

Ramesh Vishveshwar is a tech blogger who is always on the lookout for the next big thing. Having discovered his infatuation for various flavors of Linux, he spends his time tinkering with VPS nodes installing and trying out new applications. His interest in coding spans across multiple languages from PHP, shell scripting to remote old generation languages such as COBOL.