Note: This will not work in a jail because Poudriere requires additional permissions. But you should be able to run this in VirtualBox.
Background
In this tutorial we will install and configure Poudriere, a tool for building packages on FreeBSD.
Requirements
Poudriere
Installation
sudo pkg install poudriere
Configuration
Serving Up Packages
Needs explaining:
sudo mkdir -p /usr/jails/pkg/usr/local/share/poudriere/html sudo mount_nullfs /usr/local/share/poudriere/html /usr/jails/pkg/usr/local/share/poudriere/html sudo mkdir -p /usr/jails/pkg/usr/local/poudriere/data/.m sudo mkdir -p /usr/jails/pkg/usr/local/poudriere/data/cache sudo mkdir -p /usr/jails/pkg/usr/local/poudriere/data/logs sudo mkdir -p /usr/jails/pkg/usr/local/poudriere/data/packages sudo mkdir -p /usr/jails/pkg/usr/local/poudriere/data/wrkdirs sudo mount_nullfs /usr/local/poudriere/data/.m /usr/jails/pkg/usr/local/poudriere/data/.m sudo mount_nullfs /usr/local/poudriere/data/cache /usr/jails/pkg/usr/local/poudriere/data/cache sudo mount_nullfs /usr/local/poudriere/data/logs /usr/jails/pkg/usr/local/poudriere/data/logs sudo mount_nullfs /usr/local/poudriere/data/packages /usr/jails/pkg/usr/local/poudriere/data/packages sudo mount_nullfs /usr/local/poudriere/data/wrkdirs /usr/jails/pkg/usr/local/poudriere/data/wrkdirs
References
This tutorial is largely based on the following Digital Ocean article:
How To Set Up a Poudriere Build System to Create Packages for your FreeBSD Servers