Because I switched this year from Linux to FreeBSD I don't have Linux Containers (e.g Docker). A much simpler containerization is FreeBSD jail(8) which has been around since the FreeBSD 4.x which is released over 20 years ago! A note must be made It is not as advanced as the Linux counterpart with its complex namespaces implemented as CLONE_* system calls to limit memory, CPU resources etc, etc. This post is based on FreeBSD release 12.1 so your results may vary.
Starting, stopping and restarting a single jail
Control of individual jails uses the system
service command with the
jails service and its parameters.
Showing all running jails
For showing all running jails with its IP, Hostname and Path the
jls command is used.
Enter a jail shell
To enter a jail with an interactive shell the
jexec command is used.
Fixing DNS not working in the jail
A vanilla FreeBSD tarball run under a jail when using a jail configured static IP doesn't
have the DNS resolver configured. FreeBSD DNS resolver uses the
/etc/resolv.conf file to
get the DNS server list to make the actual request. So when using
drill to get a DNS A record
IP it gives an error.
You must create the
/etc/resolv.conf file with e.g
nameserver 188.8.131.52 pointing to
the primary Google DNS server.