TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Docker-boot – Run a system from RAM without LiveCD

27 pointsby purplesyringaabout 1 year ago
How often do you screw up the system so much you have to reformat the disk (without losing data) to fix it? Well, sometimes I do, and sometimes I can&#x27;t be bothered to burn a live ISO onto a USB stick. There&#x27;s initramfs, but it&#x27;s hardly a pleasant environment, with network configuration and all.<p>My go-to solution has typically been to create a chroot with busybox and a few utilities in &#x2F;tmp, chroot into it, and then kill services that use the solid drive so that I can unmount it. That&#x27;s an error-prone process, and sometimes systemd itself uses disk, so you can&#x27;t unmount the drive despite killing all the userland but PID 1.<p>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.<p>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.

3 comments

DigitalHackOpabout 1 year ago
&gt; How often do you screw up the system so much you have to reformat the disk (without losing data) to fix it?<p>Never. But I am curious as to what you are doing to get into this situation so often.
评论 #40036705 未加载
评论 #40036681 未加载
评论 #40039362 未加载
yjftsjthsd-habout 1 year ago
Broadly a neat idea, and props for actually following through. I am in fact a big fan of:<p>&gt; I&#x27;m a Nix contrarian, so naturally I wanted something to be to Docker like NixOS is to Nix. docker-boot fills this niche.<p>not least because I&#x27;ve also been trying to figure out if there isn&#x27;t a way to do <i>nearly</i> everything nix does with way better ease of use using docker or something similar.<p>That said,<p>&gt; 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.<p>is needlessly combative and also not really a comparison that makes your solution look good; neither of those options &quot;pollute&quot; 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&#x27;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.
评论 #40045085 未加载
评论 #40039325 未加载
k8svetabout 1 year ago
&gt;also drives libostree and Nix users mad<p>no, it really doesn&#x27;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.)<p>&gt; How often do you screw up the system so much you have to reformat the disk (without losing data) to fix it?<p>Have you heard of NixOS? Where this is nigh impossible?<p>lol
评论 #40044473 未加载