4 ms·
Jails have been around for a while in FreeBSD and they are often used for this exact purpose; the concept has only, really, entered the mainstream due to widesp
by Ixiaus 13y ago
Jails have been around for a while in FreeBSD and they are often used for this exact purpose; the concept has only, really, entered the mainstream due to widespread usage of EC2/OpenStack and now Docker (which is basically FreeBSD Jails + ezjail but for Linux and a little different on some other fronts).
Nothing beats a bare metal machine with FreeBSD + ZFS pool + ezjail; the really cool thing about ZFS is that you can build a "base jail" then just use ZFS to make snapshots of the base jail when creating new jails. So with that you can create versioned base jails that are running an upgraded ports tree, or more generally, an upgraded world build!
It also makes transition between application versions easy because you can run a separate database jail(s) (maybe different versions of the db?) and have a jail for app v1 running while a jail for app v2 is running at the same time.
What I would love to see is a tool for abstracting this deployment pattern on-top of ezjail. I've been considering doing this myself but my time is stretched too thin :(
- mwcampbell 13y agoInteresting. The one core OS feature that FreeBSD seems to be missing is a server-class virtualization technology, like KVM on Linux. Please correct me if I'm wrong on that. Of course, Illumos has zones, ZFS, KVM, and DTrace. But it's much less widely used than even FreeBSD.
- derefr 13y ago> the really cool thing about ZFS is that you can build a "base jail" then just use ZFS to make snapshots of the base jail when creating new jails btrfs also supports this, and that support is built into some LXC commands (lxc-clone, for instance.) Docker just relies on filesystem overlays and bind-mounts instead, though, so it doesn't really have need for full persisted-to-disk subtrees of the instantiated version (it's more like it holds the base version and the persisted delta on disk, and only brings them together in memory.)
- ninetenel 13y agoSeriously .. FreeBSD is only used by two types of people gays and downs babies
- shykes 13y ago> What I would love to see is a tool for abstracting this deployment pattern on-top of ezjail. I've been considering doing this myself but my time is stretched too thin :( This is basically what we're doing with Docker. We started with lxc but it can and will be ported to other OS virtualization backends, including jails and zones. Create a new base image from a running container: CONTAINER_A=$(docker run -d ubuntu apt-get install curl) docker wait $CONTAINER_A docker commit $CONTAINER_A shykes/my-ubuntu-with-curl CONTAINER_B=$(docker run -d shykes/my-ubuntu-with-curl curl --help) Share your new image for the rest of the world to enjoy: docker push shykes/my-ubuntu-with-curl Transition between application versions: V1=$(docker run -d shykes/myapp:v1) V2=$(docker run -d shykes/myapp:v2) docker stop $V1 Transition between database versions (sharing of persistent data): V1=$(docker run -d shykes/mydb:v1) V2=$(docker run -d -volumes-from=$V1 shykes/mydb:v2) docker stop $V1