4 ms·
Back before the birth of docker when I was consulting, a friends startup wanted a way to install their multi component application (web service, database etc.)
by noufalibrahim 4y ago
Back before the birth of docker when I was consulting, a friends startup wanted a way to install their multi component application (web service, database etc.) inside a corporate environment. They built it on a Debian setup and generally apt-getted (apt-got?) all their requirements, used supervisord to manage the backend process (written in Python) and had it running. To do this on prem, they needed an installer.
I cooked up this idea of creating a dummy file (dd), formatting it into a file system, mounting it as a loopback device and deb-bootstrapping it. Then I chrooted inside it, installed all the dependencies needed, added all the code and things we needed for the application, left the chroot and use makeself to create a self extracting zip file of the whole application along with an initial config dialogue. We wrapped up the process using a Python script so that people create such "installers".
Once you ran the file, it would unzip itself into /opt/{something} and start up all the processes. Inside the chroot was Debian with a db and several other things running. Outside the chroot was Redhat or whatever. It ran surprisingly well and was used for a couple of years for all their customers even after Docker came out. I rejoined them as a contractor after they got a decent amount of funding and the same thing was still in use .
I wrote about this as an answer to a Stack Overflow question back then https://stackoverflow.com/questions/5661385/packaging-and-shipping-a-python-library-and-scripts-the-professional-way/5731719#5731719 https://stackoverflow.com/questions/5661385/packaging-and-sh...
It was a proto docker without proper process isolation. Just file system isolation using chroot. Definitely brought back memories. The real value docker added was standardization, a central container registry, tooling etc. It mainstreamed these kinds of arcane old school sysad tricks into a generally usable product.
- ilyt 4y agoWe did that for some web hosting client it worked but managing this wasn't exactly pleasant. Then again there isn't much managing if instead of upgrading the system you rebuild it from scratch every time.
- noufalibrahim 4y agoYup. That's the reason why we did this.
- nonrandomstring 4y agoBrings back lovely memories of Knoppix days. That's more or less how we used to mod CD based distros, mounted as looped-back filesystems. Maybe another missing link in the continuum between simple chroot and full VMs is User Mode Linux (UML). Whatever happened to that? Didn't it get folded into Linux kernel as a standard thing at some point? Why do we never hear much of it now?
- flyinghamster 4y agoI haven't really kept up with it, but I didn't find it in a cursory check of 6.0.7. Linode used UML when they were first starting, before eventually moving to Xen and then KVM.
- mcculley 4y agoIt is still there: https://github.com/torvalds/linux/tree/master/arch/um https://github.com/torvalds/linux/tree/master/arch/um
- flyinghamster 4y agoThanks - I can think of edge cases where it can still be useful (particularly for kernel development). I didn't wade deeply enough into menuconfig to find it.
- xmodem 4y agoThere's now also gVisor
- goodpoint 4y ago> I cooked up this idea of creating a dummy file (dd), formatting it into a file system, mounting it as a loopback device and deb-bootstrapping it. This has been used for 2 decades. It's extremely common for embedded systems.
- noufalibrahim 4y agoI have very little embedded experience. I think I got the general approach from a python script shipped with Ubuntu to create bootable thumb drives but I might be misremembering.
- pjmlp 4y agoOn HP-UX we would just use vaults, already in 1999.
- hinkley 4y agoHalf of the things we front page are retreads of minicomputer and supercomputer tech, some of it as old as the late 1980’s. I’m wondering what will happen and what sort of retrospectives will occur when the people involved spend enough time researching existing techniques and discover they’re covering old ground.
- pjmlp 4y agoIt is going to be the equivalent of rediscovering ancient Roman, Greek, Egyptian, Babylonian, Maya, Aztecs,... technology.
- yjftsjthsd-h 4y agoWhat was the advantage to creating a filesystem in a disk image rather than just extracting a root tarball somewhere and chrooting into it?
- coldacid 4y agoThe filesystem-in-a-file was to produce the contents of the root tarball that was extracted somewhere (in /opt per OP) and chrooted into.
- noufalibrahim 4y agoYes. It was also the first time I used makeself which I quite liked.