6 ms·
FreeBSD is growing more and more on me, mostly because of Jails ( also ZFS ). Call me a boomer, but I still think "containers"/Docker is not a solid, simple an
by PedroBatista 3y ago
FreeBSD is growing more and more on me, mostly because of Jails ( also ZFS ).
Call me a boomer, but I still think "containers"/Docker is not a solid, simple and robust solution for isolation.
- pjmlp 3y agoWe had lpar, vaults, zones, jails, but it was docker that won the mindshare, to the point many think it was the first.
- yjftsjthsd-h 3y agoIn fairness, I'm not aware of any preceding container/jail/whatever system that handled the packaging and distribution of software like docker did, and I suspect to most users that's more important than the containment features. Or am I forgetting something else that did that, too?
- bayindirh 3y agoYou actually don't need that all packaging stuff for ease-of-use much. Compile your application with required libraries to a subfolder, define the jail's root as that subfolder, and fire the app. It's similar under Linux's CGroups. You fire the binary inside another CGroup and, that application thinks that it's the only thing on the machine, and may feel a little lonely, with its own IP and isolated network stack and such.
- yjftsjthsd-h 3y ago> You actually don't need that all packaging stuff for ease-of-use much. Compile your application with required libraries to a subfolder, define the jail's root as that subfolder, and fire the app. I can download and run anything in any accessible OCI registry with a single `docker run` command. The only thing I've seen that makes jails even remotely close to being as easy and quick to use... is using runj to recreate the same experience. > It's similar under Linux's CGroups. You fire the binary inside another CGroup and, that application thinks that it's the only thing on the machine, and may feel a little lonely, with its own IP and isolated network stack and such. Yeah, I know how the isolation features work, my point is that they're not nearly as important. For the vast majority of docker use, you could replace the actual container with chroot and not really make any difference, and the chroot is only to save the trouble of having to modify the application to handle host paths, not as a security barrier. Docker's killer feature isn't containers, it's images that are easy to move around and run, and to slightly lesser degree Dockerfiles that provided a standardized format to describe how to build those images. I love FreeBSD, but I think this kind of illustrates how the community has really dropped the ball on containers: Nobody cares that jails are technically superior and far more elegant under the hood, or that they've been here longer than on linux, or whether their security position is better. Docker was and is overwhelmingly better UX; all the under the hood stuff is effectively irrelevant to users.
- bayindirh 3y agoWell, not all shops just blindly install docker, pull a docker compose stack and call it day. Many of us out there compile their apps, stash into a cgroup or a jail and fire it. Just because mainstream developers using "that one thing", it doesn't mean that the whole world has abandoned other ways to do things. I personally doesn't pull any big software package from an OCI registry, because I don't trust the installation and don't like the reduced configurability of the packages involved. If I'm lazy for that day, I pull Debian minimal, build the thing I need, push to our local registry and call it a day. Otherwise I install that thing properly, run it under cgroups, or under its own VM if the workload warrants it, and get a mug of coffee. > Nobody cares that jails are technically superior and far more elegant under the hood... Believe me, some shops care.
- yjftsjthsd-h 3y ago> Many of us out there compile their apps, stash into a cgroup or a jail and fire it. > If I'm lazy for that day, I pull Debian minimal, build the thing I need, push to our local registry and call it a day. I'm 100% sympathetic to not using public images, but it really sounds like you've just re-invented docker with extra steps. Or in the second case, like you are using docker just without the public images?
- bayindirh 3y agoFirst case is not re-inventing Docker, it's just not changing our ways. We continue doing what we're doing, but using modern facilities to isolate or resource-control the workload we're running. In the second case, the only thing I pull is "Debian Slim" from the public repo. Since I'm using Debian for a very long time, I can actually verify down to last bit (package/binary checksums, etc.). Then built the rest from the source + Debian repositories inside a Dockerfile. I push the container to local registry, and Dockerfile to our local Git server.
- throw0101c 3y ago> Well, not all shops just blindly install docker, pull a docker compose stack and call it day. "Hitler uses Docker": * https://www.youtube.com/watch?v=PivpCKEiQOQ https://www.youtube.com/watch?v=PivpCKEiQOQ
- dmpk2k 3y agoZones and ZFS streams came close (but the main problem there is that ZFS assumes that ZFS streams are trusted...).
- clan 3y agoPersonally I find the FreeBSD package approach more elegant. We have the "pkg" package manager as standard on the system. If you want to install into a jail you simply add the -j flag. There has not been a lot of documentation on how to do service jails. Maybe because a full jail (with a full and reasonably sized OS) is so trivial to setup. But there is no denying that Docker have had great marketing and a good use case. I do however think the real reason no matter how much of a FreeBSD Jail or Solaris Zones fan boy you are - you know that Linux is the elephant in the room. That brand name alone without arguing distributions. Linux already had a huge market and mindshare compared to FreeBSD or Solaris. And when Linux got CGroups you had (within reason) feature parity. For anyone who are not daily distro switchers changing your base OS is no minor feat. So even if CGroups was not perfect the incentive to switch is not huge. But it does make me sad that Docker has become so prevalent that a Docker image is the only way some projects make releases. All too commonly without documenting the build steps. Do not be so hard on your posix friends, please!
- nolist_policy 3y ago> All too commonly without documenting the build steps. That's the great thing with Docker, all you need is documented in the Dockerfile.
- clan 3y agoYou seem to be in the "read the code" camp. I am not. Rather than using plain language and reason about dependencies, limitations, workarounds and more or less informed choices you need to infer this from the Docker file. Pray that they have left even a single little comment regarding non obvious issues. Akin to saying everything is documented in the Makefile. Why not a quick glance a main() to see if we parse any args. You can give people step by step instructions on where to go. But you empower them with a map. Documentation is hard. Quality documentation even harder. A dockerfile is a very poor substitution for me. I do not mind projects who prefer Docker and they get all my love and appreciation if they document the manual building steps. And I am totally fine by them telling me I should probably not do that. But I am seeing more projects skipping this and instead spend effort and time on using and debugging with Docker. But I am old and my beard is getting grey. I have learned to fear the programmer who tells me to read the code to understand the system. I have been told that it is concise and is good for velocity. Not everything old is good and we should move on. I for one miss the days when documentation was considered a priority.
- pjmlp 3y agoBecause the previous systems were about applications security, not about shipping the developer's machine into production, which is what most Docker containers are about.
- bayindirh 3y agoFrom my understanding, Linux CGroups proved itself to be a viable alternative to jails, because, it provided "Linux inside Linux" in practice. Also, if my memory serves right, jails had some performance impact for the workload inside the jail. Docker, as you know better than me, is just a wrapper over CGroups, nothing else, plus a container image format, basically. In the end, CGroups provided what jails provided with the same and better performance, and someone leveraged that subsystem with a tool, before everyone else.
- clan 3y agoMemory serves you wrong. No performance impact running inside the jail as it is basically just a jail id managed by the kernel. I have no qualms with neither Linux nor CGroups. Great technology in itself. No reason to spread FUD.
- bayindirh 3y ago> Memory serves you wrong. Well, OK. > No performance impact running inside the jail as it is basically just a jail id managed by the kernel. Thanks for letting me know. > No reason to spread FUD. I was just relaying what our system and BSD guy said back in the day. I have nothing against BSD. That quote was before hardware virtualization days, BTW.
- clan 3y agoVirtual Machines (VMs) is 1960's technology. Started out on the mainframes. x86 virtualization came along in the 1990's. VMware Desktop everybody knows today was released around 1999. Other players have been around. This is the same year jails was introduced with FreeBSD 4. The funny thing is that jails are often referenced as "virtualization without the overhead". Jails are really fast as it is the same shared kernel. Hardware VMs have additional security advantage as a guest kernel vulnerability will (normally) not affect ofter guests. But it comes at a cost.
- bayindirh 3y ago
- tambourine_man 3y agoI dream of a “chroot is all you need” successor to Docker. I’m not a boomer, but I’m considered old in this industry.
- pram 3y agoYou can accomplish a whole lot these days with the systemd service parameters like Private* and Protect*
- tambourine_man 3y agoThe idea with chroot is for compatibility with anything POSIX
- nolist_policy 3y agoI needed to look at your comment for 10 minutes before I got what you mean. So you want containers that run on any POSIX operating systems? You can do this with ptrace() which is in POSIX, but its going to be slow for i/o heavy applications. Unfortunately POSIX doesn't provide anything else (seccomp would already be a step up). See also proot[1], gVisor[2] and User Mode Linux[3] which all use ptrace(). [1] https://github.com/termux/proot https://github.com/termux/proot [2] https://gvisor.dev/docs/architecture_guide/platforms/#implementations https://gvisor.dev/docs/architecture_guide/platforms/#implem... [3] https://www.kernel.org/doc/html/v5.9/virt/uml/user_mode_linux.html https://www.kernel.org/doc/html/v5.9/virt/uml/user_mode_linu...
- tambourine_man 3y agoSorry, here's a slightly more serious attempt at a decent comment: my hunch is that most of what people look for in Docker could be accomplished by simple file system isolation and a few env variables. Something that could be hacked together with chroot and shell scripts. This much simpler solution could be replicated in basically any decent OS and wouldn't require shipping an entire Linux kernel and deal with slow IO and the network hoops to jump through on anything that isn't Linux. The same directory of ready-made solutions that Docker enjoys today could be rebuilt uppon this simpler stack. When you realize that linking to the right libraries gets you most of the way there already, you begin to think there's a gem of a solution hidden in plain sight among all this mess.
- jlouis 3y agoOnce you've seen the (older) alternatives, you cringe at Docker, indeed. Jails is a better solution. So is (Solaris/Illumos) zones. Nix is a great way to jump over docker entirely. You can then output a container from Nix if you need it, but you aren't limited by them at all.
- nortonham 3y ago>Jails is a better solution. So is (Solaris/Illumos) zones. Can you explain why? It's not something I know a lot about so I'd be interested to learn about
- jcranmer 3y agoAs I see it, there are roughly four main related features that Docker brings, though it is far from the only solution to bring these features: 1. The ability to create services in a clean slate environment. Unix processes tend to inherit by default most environment attributes--working directory, open file descriptors, etc.--and having a way to create a process (or group of processes) without inheriting all of that stuff is easy. 2. Virtualization/isolation in a lighter weight solution than a full virtual machine. 3. Checkpointing that allows you to consistently restart an image with a given configuration, even if you go on to horribly destroy it in tests or whatnot. 4. A language for designing how to construct these images (the Dockerfile). I suspect the popularity of Docker mostly comes from the latter, and I'd definitely like to see something like that but utilizing jails and ZFS features instead.
- hotnfresh 3y agoMy primary use of Docker is as an isolated-installation package manager that’s portable cross-distro and cross-distro-version with exceptionally well-documented and easy-to-test config locations and data storage paths (so much easier to be sure you’ve backed up everything you need to). Docker minus the giant well-populated well-maintained image library would be almost useless to me. [edit] one daemon improved immeasurably by Docker is Samba, of all things. The invocations are a little arcane, but once you’ve got them figured out it’s one extra option line to add a user, one line to add a share, repeat as needed. So very much better than relying on distro-magic to make it work, or, god forbid, trying to configure it manually with some config file that ends up inexplicably having no portability, or is silently ignored despite the claims of the docs, or doesn’t work at all because there’s some option commented out by default that definitely shouldn’t be. Docker forced them to finally make the “I just want to share a damn directory, to these users, either read only or read-write” use case, which is probably the vast majority of use of Samba, straightforward, concise, and reliable to configure.
- forinti 3y agoI'm surprised someone hasn't written a jails-like wrapper for starting containers in Linux.
- aforwardslash 3y agoThey have. Its called LXC. There are some differences when compared to "modern" jails (which, due to virtual network and cpu sets, are more close to solaris Zones in terms of functionality), but basically the same core functionality.
- forinti 3y agoIn fact it is. I've been overlooking LXC for so long. Thanks for the tip.