Building ports in a jail
aimless55 opened this issue · comments
I'm new to bsdploy and jails.
When I create a new virtualbox instance and jail (like when following the quickstart), I am unable to build any ports after SSHing into the jail. To make the ports available I first have to connect to the ezjail master and fetch and extract the ports tree into the base jail with portsnap fetch
and portsnap -p /usr/jails/basejail/usr/ports extract
. Then the ports are available within the jail, but I get errors when I try to build anything due to /usr/ports
being a read-only file system. After some searching I found that I could fix that by adding options to /etc/make.conf in the jail. At that point everything works fine.
My question is, what is the proper workflow for doing all of this in bsdploy? I am guessing that editing /etc/make.conf
every time I create a new jail is not the answer. Isn't this something bsdploy should do by default, or do I need to create an ansible task to make the proper edits and always assign it to every jail?
We completely rely on pkg
to install packages instead of using ports which use a lot more space and need time to compile. To install something with custom options, you should use poudriere
and change the repository URL where pkg
is looking.
If you still want to use ports, then you could either use ploy configure
(see here) to edit /etc/make.conf
, or use the startup_script
feature of ploy_ezjail (see here) which is used by bsdploy to install python in the jail on startup. It might make sense to mount a persistent folder into the jail for the ports in that case, so if you recreate the jail you don't have to recompile all the ports again.
Got it. Thanks!