I've been playing with Docker a little bit; as you know its the hype of the moment, and is getting some traction. Its one of this projects I would like to see surviving its hype, because the concepts behind it are really good. Is AnotherWayOfSeeingThings(tm); you containerize EVERYTHING on your stack, with the benefit that you can very easily distribute your application in different hosts without almost any extra overhead. It reminds me to the Erlang programming language, where all its processes (also called actors) can be spawned in any hosts of the cluster, since all the information is transfered by messages between them and there is very little shared.
This post is not about Docker, but of a new operating system called CoreOS that provides you the tools to manage a Docker cluster. It comes with systemd, etcd, fleet and docker installed by default.
The first thing you want to know about coreOS is a lightweight operating system based on Linux. The project has 13 months, so its pretty young. It has the minimum functionality for deploying ever. Example: it does not provide a packet manager. Basically you cannot install your stuff there. Even if you want to compile tools from scratch yourself you'll need the compilers, and the usual *-dev packages that you'll be unable to install. The idea behind it is that everything you want to run must be in a container and CoreOS will just operate as HOST operating system. Said in another way: you don't run a Docker container using coreOS as operating system.
Another particularity is the filesystem; the root partition (/) is read only. They don't want you to use it and maintain state in any node of the cluster. If you want to keep state, there are partitions where you can write, but beware that if the machine dies you won't be able to recover this information. Again, use containers instead to replicate the information if required.
Another difference are the updates of the operating system itself; the OS is based on Chrome OS and they don't use the typical approach of updating packages one by one. Chrome OS update consists in the download of a whole root filesystem and they have a primary and secondary root partition. The idea is that you download the update and after reboot the OS is loaded with the new root partition; is something fails during the processes, you can fallback to the original partition. This system is based on Google's open source project Omaha.
CoreOS is mean to be provisioned using something like User Data in AWS; on bootup of the instance/droplet you provide a configuration file that defines the cluster information and how this element must behave. As far as I know all the nodes on the cluster can perform the same actions, like see all the nodes, list the processes or show the logs produces by each service. If you register new services and spawn new services they will be created in different hosts of the cluster with the given rules. All the services are systemd units, you use this for spawning new containers, etc.
To be honest a lot can be said about CoreOS but I'm not a big fan of new distributions. The ideas are good but I don't see why we cannot do the same with a Debian distribution once systemd gets shipped with it by default. The ideas of CoreOS are quite interesting and if you want to learn how to deploy Docker applications is an awesome way to go. I really encourage you to see the following articles:
- Getting Started with CoreOS, links
- An Introduction to CoreOS System Components
- How To Set Up a CoreOS Cluster on DigitalOcean
- How To Use Fleet and Fleetctl to Manage your CoreOS Cluster
- How To Use Etcdctl and Etcd, CoreOS's Distributed Key-Value Store
- How To Create and Run a Service on a CoreOS Cluster
- How to Create Flexible Services for a CoreOS Cluster with Fleet Unit Files
- How To Use Confd and Etcd to Dynamically Reconfigure Services in CoreOS
- How To Troubleshoot Common Issues with your CoreOS Servers
Again, if you want to test all this guides in DigitalOcean, you can use this affiliate link and get $15 to play with. I'll get $25 in DigitalOcean credits also, so I thank you in advance also. Win-win situation!