Live data from Hacker News

Immutable Software Deploys Using ZFS Jails on FreeBSD

conradresearch.com

21–30 of 54 posts

Re: Immutable Software Deploys Using ZFS Jails on FreeBSD

#21
post #5

Earlier quoted context omitted.

This is more like making an immutable linux container using only OS base tools. Docker is a whole stack doing the work for you.

I have to imagine systemd’s nspawn with btrfs integration took much inspiration. Combined with systemd’s service configuration it really makes a wonderful way of running distroless, immutable containers.

I second systemd-nspawn being a hidden gem for this usecase. I use git post-recieve hooks that target it for much of my ci/cd pipelines.

I also find myself using nspawn just to isolate apps like firefox, etc.

Re: Immutable Software Deploys Using ZFS Jails on FreeBSD

#22
post #16

Earlier quoted context omitted.

Yeah I would love to use FreeBSD jails with ZFS and everything, it’s just that the whole cloud and containerization thing happened based on Linux and FreeBSD just never made it into that ecosystem. You’ll be sacrificing a lot and have to hand-roll a lot if you want your organization to switch from Linux+docker to FreeBSD+jails

It's all just history now for all I know, but there was work in the past to make Linux containers work on a Solaris fork (SmartOS, specifically) by emulating the Linux syscall table and presenting that to the containers. Joyent did work on this (alas, and there's an excellent and entertaining talk from Bryan Cantrill[1] that goes over it. I imagine FreeBSD could do something similar if they aren't already. IIRC FreeB…

Yeah, emulating syscalls is fine until it isn’t. See WSL1.

Re: Immutable Software Deploys Using ZFS Jails on FreeBSD

#23

Earlier quoted context omitted.

I never find arguments like this compelling (but I agree with your sentiment). I don’t much care to fire up the time machine to go back 12 or more years to develop software today. If your argument is that ZFS and jails provide the same functionality but are more stable than Docker. But as is it comes off as “get off my lawn you young whipper snappers”. But at the same time, the reason Docker won was not because it wa…

Yeah I would love to use FreeBSD jails with ZFS and everything, it’s just that the whole cloud and containerization thing happened based on Linux and FreeBSD just never made it into that ecosystem. You’ll be sacrificing a lot and have to hand-roll a lot if you want your organization to switch from Linux+docker to FreeBSD+jails

I think there's FreeBSD images for all the clouds now.

You would need to do more work yourself to fetch and run jails probably, and I don't know if there's a hosted repository of 'jail images', but in return, you'd probably have a nicer system (at least, I'd like such a system more than running containers on google container optimized linux)

Re: Immutable Software Deploys Using ZFS Jails on FreeBSD

#25

Earlier quoted context omitted.

I never find arguments like this compelling (but I agree with your sentiment). I don’t much care to fire up the time machine to go back 12 or more years to develop software today. If your argument is that ZFS and jails provide the same functionality but are more stable than Docker. But as is it comes off as “get off my lawn you young whipper snappers”. But at the same time, the reason Docker won was not because it wa…

> especially when you are on Linux AND on macOS. I can’t run FreeBSD jails or ZFS on macOS, can I? Definitely not with one file and one command. On macOS, docker actually launches a Linux VM to run containers. If this counts, then yes, you can run FreeBSD jails or zfs on macOS, by running a FreeBSD VM.

[deleted]

Re: Immutable Software Deploys Using ZFS Jails on FreeBSD

#27

I hope OCI containers support make this boilerplate obsolete.

It already is, if you use most jail managers, this post is a manual approach.

I really don’t like jail managers because I need to learn a non-standard way to operate jails when I already know the manual approach. I just wouldn’t miss the boilerplate. Also, OCI containers > jail managers.

Re: Immutable Software Deploys Using ZFS Jails on FreeBSD

#28

Earlier quoted context omitted.

Yeah I would love to use FreeBSD jails with ZFS and everything, it’s just that the whole cloud and containerization thing happened based on Linux and FreeBSD just never made it into that ecosystem. You’ll be sacrificing a lot and have to hand-roll a lot if you want your organization to switch from Linux+docker to FreeBSD+jails

What about FreeBSD+OCI containers https://freebsdfoundation.org/blog/oci-containers-on-freebsd...

In my opinion this is the path forward. I can already imagine Hashicorp Nomad orchestrator, with the podman driver, running fleets of FreeBSD containers.

Re: Immutable Software Deploys Using ZFS Jails on FreeBSD

#29
post #3

For those unfamiliar with FreeBSD, this is using base OS tools to manually create this type of immutable jail/container. This can be done with 'less effort' by using a jail manager.

Jail managers come and go. Base OS tools stay and are getting better and better. I would definitely stay away from ezjail as it us quite old, active development or even maintenance has stopped long time ago.

Author of the article seem to know what they are doing so I'm puzzled why they don't use `bsdinstall jail /path/to/jail` to implement basejail instead of manually unpacking archives.

No need for separate custom rc script to start `lo1`, it can be done with `cloned_interfaces` directive in rc.conf.

Updating and upgrading jails by passing `-b /path/to/jail` to `freebsd-update` works, but new recommended way has lately been `-j `.

Cool article overall, the beauty of FreeBSD is also in possibility to do things in many different ways.

Re: Immutable Software Deploys Using ZFS Jails on FreeBSD

#30
post #22
post #16

Earlier quoted context omitted.

It's all just history now for all I know, but there was work in the past to make Linux containers work on a Solaris fork (SmartOS, specifically) by emulating the Linux syscall table and presenting that to the containers. Joyent did work on this (alas, and there's an excellent and entertaining talk from Bryan Cantrill[1] that goes over it. I imagine FreeBSD could do something similar if they aren't already. IIRC FreeB…

Yeah, emulating syscalls is fine until it isn’t. See WSL1.

Some kernels are more similar to others, some are less. Turns out NT is less similar to Linux than required for good performance. I wouldn’t be surprised if Solaris was similar enough given that Linux tries to be Unix-like and Solaris is actually Unix.
Post reply on HN