On Friday DigitalOcean announced the availability of CoreOS on their platform.

CoreOS is a very optimized Operating System which is designed to just run containers. While it has some very powerful clustering elements made up of ….

…. I decided my first step should be to do the opposite of every blog post I have read about CoreOS and run a single instance with the tools I am used to using.

The first thing you will notice about CoreOS when you first access it is that it is very stripped down and the bulk of the operating system is installed on read-only partitions, this is due to the way CoreOS provide updates, rather than providing patches to packages they deploy an updated version of the entire operating system in one go.

This philosophy makes things interesting when it comes to installing Fig, nsenter & docker-enter. As you can see from the following, we install all of the tools into a read / write partition in the core users home directory;

mkdir -p tools/bin
docker run — rm jpetazzo/nsenter cat /nsenter > tools/bin/nsenter
curl -L https://raw.githubusercontent.com/jpetazzo/nsenter/master/docker-enter > tools/bin/docker-enter
curl -L https://github.com/docker/fig/releases/download/0.5.2/linux > tools/bin/fig
chmod +x tools/bin/*

Once our basic toolset is installed we have to add the binaries to the system paths;

mv .bashrc .bashrc-original
curl -L https://raw.githubusercontent.com/russmckendrick/coreos/master/bashrc > ~/.bashrc
sudo curl -L https://raw.githubusercontent.com/russmckendrick/coreos/master/bashrc > ~/.bashrc
sudo ln -s /root/.bashrc /root/.bash_profile
source ~/.bashrc

and thats it, we can now use fig, nsenter and docker-enter as the “core” & “root” users.

Next up is to add our NGINX proxy, rather than use fig for this I will use systemd;

sudo curl -o /etc/systemd/system/nginx-proxy.service https://raw.githubusercontent.com/russmckendrick/coreos/master/nginx-proxy.service
sudo systemctl enable /etc/systemd/system/nginx-proxy.service 
sudo systemctl start nginx-proxy.service
sudo systemctl status nginx-proxy.service

and thats it, we have a stripped down Operating System which is geared to running just containers while maintaining a tool-set we know. However, as with everything cloud, this is a massive single point of failure. When I next post about CoreOS I will cover how to do it properly and create a cluster.

Written by Russ McKendrick

I am he as you are he as you are me and we are all together

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s