I just came across a great feature of IOCAGE which I'd like to share:
Automatic Package Installation
Packages can be installed automatically at creation time!Use the [-p | –pkglist] option at creation time, which needs to point to a JSON file containing one package name per line.
Note
An Internet connection is required for automatic package installations, as pkg install obtains packages from online repositories.
Create a <span>pkgs.json</span> file and add package names to it.
<span>pkgs.json</span>:
{
"pkgs": [
"nginx",
"tmux"
]
}
Now, create a jail and supply <span>pkgs.json</span>:
iocage create -r [RELEASE] -p [path-to/pkgs.json] -n [NAME]
Note
The [-n | –name] flag is optional. iocage assigns an UUID to the jail if [-n | –name] is not used.
This installs nginx and tmux in the newly created jail.