RancherOS: An OS for Docker Containers
rancher.com
rancher.com
Good things they've thought through:
- boots fast, does almost the absolute minimum it needs to get up and running
- supporting user data and at least minimal config via cloud-init
- properly minimal: you have to use a Debian image to set up persistent storage with mkfs.ext4! (edit: when using the ISO version, which is not the primary use case)
- but helpfully familiar: you can install distro flavoured "console" experiences with more than just busybox
- it's almost a better Boot2Docker than Boot2Docker! (a little bit of love for VirtualBox / VMware shared storage wouldn't go astray)
(Edit: Oh, you mean Docker itself as PID 1 on RancherOS. Yes, that's true. Certainly hairier than systemd. I haven't really dug into how much they limit what system-docker can do.)
- /usr/bin/systemd-docker = 8.4M
- /usr/bin/docker = 14.3M
One of those services is docker, for running Random Shit You Downloaded Off The Internet. :-)
Has anybody hit actual issues with this? Having used Docker and systemd concurrently for a while, I can't say this has every caused conflicts, any more than the fact that both myself and my guests manage drinks in my fridge.
You can see Darren's discussion of these issues here: https://groups.google.com/forum/#!msg/coreos-dev/wf7G6rA7Bf4...
Re: the post you refer to, I really don't like his proposed solution of "docker attach | docker start | docker run". I usually do this:
ExecStartPre=-docker kill %P
ExecStartPre=-docker rm %P
ExecStart=docker run --rm --name %p ...
ExecStop=docker stop %p
Of course that would not apply to any containers used to export volumes, but I tend to mount volumes from the host anyway. But I explicitly want a clean slate when I restart containers.The key thing to remember with CoreOS is it puts systemd at the center not docker and only interacts with docker through the client. In fact, there's really zero docker integration besides shipping the binary.
There's also the underlying technical issue around what is PID 1. In your example, you aren't actually monitoring the container, you're monitoring the status of the docker client, which may be different than the docker daemon. For containers, the docker daemon owns the fork rather than systemd. In a system like Kubernetes you have a reconciliation loop that monitors the daemon. You could probably build a similar idea into your unit files to make them more robust, but that's even more complicated.
Having gone down the systemd route it seems like a dead end to me for distributed docker applications. If you believe in a containerized future, then choose an orchestration framework that treats docker as first order primitive. You can still bootstrap this framework using CoreOS/systemd but after that I'd much prefer to just interact with a higher-level system.
For the same reason it doesn't really matter to me if Docker is treated as a first order primitive.
But, my question is, what does this bring to the table that isn't possible with Docker + Machine + Swarm?
That's a super important question to ask, because adding another layer to deployments is not something people are wont to do to a system (Docker) that's supposed to put the simplicity back into deployments. Also, since this isn't under Docker Inc.'s umbrella people would be right to be cautious depending on it lest it die, whether that's fair or not.
I don't use CoreOS but I get it: it offers orchestration whistles that solve some people's problems. I also don't use but I understand PaaSes like Flynn: they're solving problems at a completely different layer and their ties to Docker are incidental.
But this, the primary touted advantage seems to be that it's a slim Docker image. For me (and I imagine others) that is a solved problem with Machine and/or boot2docker. On top of not imposing any new overarching architecture to learn, those tools are already widely deployed, supported, and trusted, and have the huge unfair advantage of being blessed by Docker core.
And if you really want to run Docker in Docker, that's been supported for a very long time, and you get that for free without installing anything.
So I'm at a loss to think of a case I'd advise someone to reach for this. Is there something I'm missing?
You are correct in that it is very similar to boot2docker. boot2docker is also a very light distro with docker (and by "very light" I mean awesome slim -- steeve is amazing :) The main difference, as I see it, is in updating / extending / packages. With TCL, you need to either find the package and include it in your build or create the package with a build chain etc. which isn't trivial. In the RancherOS route, you could simply pull a new docker image.
The interesting thing to me is it offers choice. If you want to run systemd, etcd you can without changing an entire system (i.e. today, if I want Fedora with systemd I have to configure the Docker daemon opts differently than say with Ubuntu).
I've kicked around the idea of a "workstation" set of containers to run on top of CoreOS, but this is the biggest hump I've run into.
The hard part is not running X, but running X and having it display to your hardware. This is a massive distinction. You need to passthrough your graphics device so that X can write to its framebuffer and all that bizzazz, and that's the question you really should be asking. "How do I pass my graphics device / display device into a container".
Check out: https://github.com/pdevine/yoyobrawlah
You can use the run_docker.sh script to get things going. The image is also available on Docker Hub, but you need to pass in things like the dri device to get it working correctly.
https://zwischenzugs.wordpress.com/2015/02/01/win-at-2048-wi...
original link:
https://zwischenzugs.wordpress.com/2014/05/09/docker-shutit-...
https://www.usenix.org/legacy/events/atc10/tech/full_papers/...
This claim is incorrect. Linux kernels can actually be as small as around 2 MB. The rest of a working Linux system (GNU, GUI etc.) does not belong to the kernel.
http://superuser.com/questions/370586/how-can-a-linux-kernel...
A Debian Linux distribution (kernel + stuff) can run in just 32 MB. For instance:
http://stackoverflow.com/questions/1522146/minimum-configura...
Quote: "I've used a TS-7200 for about five years to run a web server and mail server, using Debian GNU Linux. It is 200 MHz and has 32 MB of RAM, and is quite adequate for these tasks. It has serial port built in. It's based on a ARM920T."
What it asserts is that there exist some minimalist Linux distros around a few hundred megabytes in size, and this can be shown true merely by example.
The claim notably does not use "all" or "every", so the existence of something smaller does not create a contradiction.
I've run Linux in embedded systems with 4MB flash and 4MB RAM too.
It's harder to keep Linux slim these days without sacrificing all kinds of things we've gotten accustomed to, but yeah, it's pretty much down to how minimalist you are willing to go rather than how small it is possible to get.
So yeah, not true at all.
(Or goof around copying stuff onto a disk image.)
You do have to put it there yourself, but if RancherOS is billing itself as small and easy to update, that seems like it shouldn't be hard.
The cool thing is, that they open sourced the SDC in November 2014.
(But you can use Docker as a user interface / API to non-Linux container implementations -- see all the stuff the Joyent folk are doing.)
I really like the idea of these micro OSes, and both CoreOS and RancherOS have some interesting aspects to them.