Jail Types

iocage supports several different jail types:

  • Clone (default)
  • Basejail
  • Template
  • Empty

All jail types have specific benefits and drawbacks, serving a variety of unique needs. This section describes and has creation examples for each of these jail types.

Clone (default)

Clone jails are created with:

# iocage create -r 11.0-RELEASE

Clone jails are duplicated from the appropriate RELEASE at creation time. These consume a small amount of space, preserving only the changing data.

Basejail

The original basejail concept was based on nullfs mounts. It was popularized by ezjail, but iocage basejails are a little different. Basejails in iocage are mounts in a jail fstab that are mounted at jail startup.

Create a basejail by typing:

iocage create -r [RELEASE] -b

Basejails mount their fstab mounts at each startup. They are ideal for environments where immediate patching or upgrading of multiple jails is required.

Template

Template jails are customized jails used to quickly create further custom jails.

For example, after creating a jail, the user customizes that jail’s networking properties. Once satisfied, the user then changes the jail into a template with:

# iocage set template=yes examplejail

After this operation the jail is found in the templates list:

# iocage list -t

And new jails with the user customized networking can be created:

# iocage create -t examplejail -n newexamplejail

Template jails are convertable by setting the template= property.

Empty

Empty jails are intended for unsupported jail setups or testing. Create an empty jail with iocage create -e.

These are ideal for experimentation with unsupported RELEASES or Linux jails.