poudriere_in_jail

Brad Davis edited this page Jan 21, 2015 · 5 revisions

Run poudriere in a jail

Warning! This can only be done on a 9.X or higher host because it needs recent jail features

DO NOT DO THIS UNLESS YOU KNOW WHAT YOU ARE DOING
IT NEEDS SOME FILESYSTEMS TO BE PATCHED TO BE JAIL READY

Create a poudriere jail in /etc/jail.conf:

poudriere {
    name=poudriere;
    host.hostname=poudriere;
    ip4=inherit;
    ip6=inherit;
    persist;
    children.max=10;
    allow.mount;
    allow.mount.devfs;
    allow.mount.procfs;
    allow.mount.zfs;
    allow.mount.nullfs;
    allow.raw_sockets;
    allow.socket_af;
    allow.sysvipc;
    allow.chflags;
    enforce_statfs=1;
    path=/jails/poudriere;
    exec.start="mount -t devfs devfs /dev";
    exec.stop="umount /dev; zfs umount -a";
}

Create the jail zfs filesystem to receive the jail:

# zfs create -p -o mountpoint=/jails/poudriere tank/jails/poudriere

Get and install the latest HEAD base.txz:

# cd /jails/poudriere
# fetch -q -o - https://pub.allbsd.org/FreeBSD-snapshots/amd64-amd64/10.0-HEAD-20120919-JPSNAP/ftp/base.txz | tar xpf -
# cp /etc/resolv.conf /jails/poudriere/etc/resolv.conf

Create the default dataset for poudriere:

# zfs create -o jailed=on tank/poudriere

Start the jail:

# jail -c poudriere

Give the dataset to the jail:

# zfs jail `jls -q -j poudriere jid` tank/poudriere
# jexec -U root poudriere zfs mount -a

On recent HEAD, instead of the above you can do:

# zfs jail poudriere tank/poudriere
# jexec -U root poudriere zfs mount -a

Bootstrap pkgng and install the needed tools if you want using things that are not default like subversion for ports:

# jexec -U root poudriere pkg install -y devel/subversion

Create a default poudriere.conf file in /jails/poudriere/usr/local/etc/

BASEFS=/poudriere
ZPOOL=tank
RESOLV_CONF=/etc/resolv.conf
DISTFILES_CACHE=/distfiles
CHECK_CHANGED_OPTIONS=yes
NOLINUX=1

Create the distfiles cache directory:

# mkdir /jails/poudriere/distfiles

Load the needed modules on the host:

# kldload tmpfs linux linprocfs nullfs procfs fdescfs

Fetch and install the latest poudriere:

# jexec -U root poudriere sh
poudriere# fetch --no-verify-peer -o - https://github.com/freebsd/poudriere/archive/master.tar.gz | tar xf -
poudriere# cd poudriere-master
poudriere# ./configure
poudriere# make
poudriere# make install

You can now play normally with poudriere:

poudriere# poudriere ports -c -m svn
poudriere# poudriere jails -c -j test -v HEAD -m allbsd
...
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.