Show HN: Docker-boot – Run a system from RAM without LiveCD (github.com)
My go-to solution has typically been to create a chroot with busybox and a few utilities in /tmp, chroot into it, and then kill services that use the solid drive so that I can unmount it. That's an error-prone process, and sometimes systemd itself uses disk, so you can't unmount the drive despite killing all the userland but PID 1.
This script improves the UX. It uses a Docker image as the chroot base, which is much easier to tailor to your needs, and automagically commits all the atrocities, such as tearing down all the userland processes, including PID 1, and re-spawning the host system from the container filesystem.
It also drives libostree and Nix users mad, because it can be used to try out a new DE or even a whole OS without polluting the host filesystem or spawning a virtual machine. The video in the README shows me trying out KDE + SDDM from a host running GNOME + GDM3.
9 comments
[ 3.9 ms ] story [ 34.5 ms ] threadno, it really doesn't. (nixos-generators has multiple ready-to-go kexec options, nixos-anywhere is entirely built on the concept, etc, etc. It would be a two-line change to pull in the kexec module into any of my computers configurations [or all of them!], and another single command to kexec reboot into it.)
> How often do you screw up the system so much you have to reformat the disk (without losing data) to fix it?
Have you heard of NixOS? Where this is nigh impossible?
lol
I'm with you. I stopped nuking and paving when I switched to NixOS. It's nice. Maybe in a few more years it'll have saved me more time than I've put into it, but it has been fun anyhow.
It's not quite utopia however. Now I have bugs which I've perfectly replicated across all of my machines. So on the one hand: I don't need any nukes. On the other hand: my nukes are now useless anyway.
Never. But I am curious as to what you are doing to get into this situation so often.
It's not common, but if you manage enough systems then even rare things happen enough that you'll need tools like this in your tool belt.
I usually reach for a live-OS booted off a USB drive (Ventoy is good for having lots of OS options on a single USB drive) but I'd be interested in giving this a try.
Edit: Phrased differently, doing the opposite of this advice: https://wiki.debian.org/DontBreakDebian is a great way to get into a situation where reinstalling is easier than fixing it.
> I'm a Nix contrarian, so naturally I wanted something to be to Docker like NixOS is to Nix. docker-boot fills this niche.
not least because I've also been trying to figure out if there isn't a way to do nearly everything nix does with way better ease of use using docker or something similar.
That said,
> It also drives libostree and Nix users mad, because it can be used to try out a new DE or even a whole OS without polluting the host filesystem or spawning a virtual machine. The video in the README shows me trying out KDE + SDDM from a host running GNOME + GDM3.
is needlessly combative and also not really a comparison that makes your solution look good; neither of those options "pollute" the host filesystem, they at most cache results thereby saving work until you tell them to garbage collect at which point it goes away (and this also means that they're not limited to the size of RAM), and neither of them needs a VM in order to cleanly transition from one configuration to another.
Sorry, wasn't my intention. I didn't mean libostree or Nix pollute the filesystem, I meant that installing a DE on a typical mainstream OS like Debian would pollute the fs. I have nothing against libostree/Nix users :)