diff options
| author | Doug Rabson <dfr@FreeBSD.org> | 2024-08-14 15:39:24 +0000 |
|---|---|---|
| committer | Doug Rabson <dfr@FreeBSD.org> | 2024-11-08 13:23:08 +0000 |
| commit | d03c82c28da86e0812b98b051d24ae5980804ad7 (patch) | |
| tree | 47cab4f9f4991cdd74fc8ee49d95453f28af38c7 /release/tools | |
| parent | f11b6ce4a3bc6d455dbec375218c01ce9b6b5dc2 (diff) | |
Diffstat (limited to 'release/tools')
| -rw-r--r-- | release/tools/oci-image-dynamic.conf | 11 | ||||
| -rw-r--r-- | release/tools/oci-image-minimal.conf | 19 | ||||
| -rw-r--r-- | release/tools/oci-image-static.conf | 42 |
3 files changed, 72 insertions, 0 deletions
diff --git a/release/tools/oci-image-dynamic.conf b/release/tools/oci-image-dynamic.conf new file mode 100644 index 000000000000..b146ff2cf7c3 --- /dev/null +++ b/release/tools/oci-image-dynamic.conf @@ -0,0 +1,11 @@ +#! /bin/sh + +# Build Open Container Initiative (OCI) container image suitable as a base for +# dynamic-linked workloads. This adds libraries from the FreeBSD-clibs and +# FreeBSD-openssl-lib packages. + +OCI_BASE_IMAGE=static + +oci_image_build() { + install_packages ${abi} ${workdir} $m FreeBSD-clibs FreeBSD-openssl-lib +} diff --git a/release/tools/oci-image-minimal.conf b/release/tools/oci-image-minimal.conf new file mode 100644 index 000000000000..122da1905436 --- /dev/null +++ b/release/tools/oci-image-minimal.conf @@ -0,0 +1,19 @@ +#! /bin/sh + +# Build Open Container Initiative (OCI) container image suitable as a base for +# shell-based workloads. This adds FreeBSD-runtime, FreeBSD-pkg-bootstrap and a +# handful of others packages to create a small image which can be easily +# extended by installing packages. + +OCI_BASE_IMAGE=dynamic + +oci_image_build() { + install_packages ${abi} ${workdir} $m \ + FreeBSD-runtime \ + FreeBSD-certctl \ + FreeBSD-kerberos-lib \ + FreeBSD-libexecinfo \ + FreeBSD-rc \ + FreeBSD-pkg-bootstrap \ + FreeBSD-mtree +} diff --git a/release/tools/oci-image-static.conf b/release/tools/oci-image-static.conf new file mode 100644 index 000000000000..27cfb3c6778c --- /dev/null +++ b/release/tools/oci-image-static.conf @@ -0,0 +1,42 @@ +#! /bin/sh + +# Build Open Container Initiative (OCI) container image suitable as a base for +# static-linked workloads. This contains mtree directories, SSL certificates and +# a few other config files. + +OCI_BASE_IMAGE= + +oci_image_build() { + mtree -deU -p $m/ -f /etc/mtree/BSD.root.dist > /dev/null + mtree -deU -p $m/var -f /etc/mtree/BSD.var.dist > /dev/null + mtree -deU -p $m/usr -f /etc/mtree/BSD.usr.dist > /dev/null + mtree -deU -p $m/usr/include -f /etc/mtree/BSD.include.dist > /dev/null + mtree -deU -p $m/usr/lib -f /etc/mtree/BSD.debug.dist > /dev/null + install_packages ${abi} ${workdir} $m FreeBSD-caroot FreeBSD-zoneinfo + cp /etc/master.passwd $m/etc + pwd_mkdb -p -d $m/etc $m/etc/master.passwd || return $? + cp /etc/group $m/etc || return $? + cp /etc/termcap.small $m/etc/termcap.small || return $? + cp /etc/termcap.small $m/usr/share/misc/termcap || return $? + env DESTDIR=$m /usr/sbin/certctl rehash + # Generate a suitable repo config for pkgbase + case ${branch} in + CURRENT|STABLE|BETA*) + repo=base_latest + ;; + *) + repo=base_release_${minor} + ;; + esac + mkdir -p $m/usr/local/etc/pkg/repos + cat > $m/usr/local/etc/pkg/repos/base.conf <<EOF +FreeBSD-base: { + url: "https://pkg.FreeBSD.org/\${ABI}/${repo}", + mirror_type: "srv", + signature_type: "fingerprints", + fingerprints: "/usr/share/keys/pkg", + enabled: yes +} +EOF + +} |
