1. 41

slim will build a micro-vm from a Dockerfile. Slim works by building and extracting a rootfs from a Dockerfile, and then merging that filesystem with a small minimal kernel that runs in RAM.

This results in a real VM that can boot instantly, while using very limited resources. If done properly, slim can allow you to design and build immutable unikernels for running services, or build tiny and embedded development environments.

  1. 4

    Looks interesting, but what is the use-case for this?

    1. 1

      In short, one use case is for building immutable infrastructure—borrowing answer from LinuxKit:

      LinuxKit runs as an initramfs and its system containers are baked in at build-time, essentially making LinuxKit immutable. Moreover, LinuxKit has a read-only root filesystem: system configuration and sensitive files cannot be modified after boot. The only files on LinuxKit that are allowed to be modified pertain to namespaced container data and stateful partitions.

      Unlike LinuxKit, you’re not limited to just read-only filesystems. This is just a simple utility for creating bootable images given a filesystem.

      Another use case is that unlike containers, you can access hardware more readily (usb, etc.), and thus provide development/computing environments for hardware dev/etc. Other things like ip addresses and multiple NICs are easier to add and work with.

      Stripping a distribution down to its most basic core is a really fun way to learn about linux systems! Interesting education opportunities.

      The final use case is that while Docker offers a nice ecosystem for building and sharing curated file systems, it is not always super desirable to also adopt the isolation/union-fs/container/chroot paradigm for development; instead, sometimes people just don’t want to pip/apt-get install everything to run a piece of code. In short, you could use this to build persistent containers, like lxc.

    2. 3

      Nice. Do you plan to add support for cloud provider VM images?

      1. 4

        We certainly plan on experimenting with different host images + filesystem combinations, so this will be on our radar.

        In the short-term, seems that exporting the instance from VirtualBox (vmdk) and upload to a provider, like digitalocean would work: https://www.digitalocean.com/docs/images/custom-images/overview/#image-requirements

      2. 3

        It would be nice to see this combined with Firecracker.

        1. 1

          Hi, this looks interesting. Do you have plans to support qemu instead of VirtualBox?

          1. 1

            Looks like it will go nicely with orderly (which I released a few days ago) :D . This is very similar to what I am doing on one of my own projects, though I use nix packages instead of docker, the end result is the same.

            1. 1

              Cool! Do you have a github link?

              1. 1

                Here is orderly: https://github.com/andrewchambers/orderly which I think would go nice as a mini init system for a group of services on slim.

                My nix vm stuff is called ‘boot2nix’ but I didn’t open source it yet - it builds a vm image that is around 50 megs or so and boots very fast, like slim :). Actually slim will also work well with nix, because nix can build docker images too. The more cool lightweight tools the better, thanks for making it :).

            Stories with similar links:

            1. Build and run tiny vms from Dockerfiles -- now supporting kvm and hyperkit authored by chrisparnin 3 years ago | 9 points | 3 comments