release: add optional OCI images
This adds three OCI archive format files to the release containing FreeBSD base images suitable for static linked, dynamic linked and shell workloads. The shell image also contains pkg-bootstrap and can be easily extended by installing packages (including pkgbase packages). Reviewed by: dch, cpersiva, jlduran, zlei Differential Revision: https://reviews.freebsd.org/D46759 MFC after: 2 days
This commit is contained in:
@@ -21,6 +21,7 @@ LDIRS= BSD_daemon \
|
||||
libvgl \
|
||||
mdoc \
|
||||
netgraph \
|
||||
oci \
|
||||
perfmon \
|
||||
ppi \
|
||||
ppp \
|
||||
@@ -199,6 +200,11 @@ SE_NETGRAPH= \
|
||||
virtual.chain \
|
||||
virtual.lan \
|
||||
|
||||
SE_DIRS+= oci
|
||||
SE_OCI= \
|
||||
README \
|
||||
Containerfile.pkg
|
||||
|
||||
SE_DIRS+= perfmon
|
||||
SE_PERFMON= \
|
||||
Makefile \
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
# This is an example showing how to extend the freebsd-minimal OCI image by
|
||||
# installing additional packages while keeping the resulting image as small as
|
||||
# possible.
|
||||
|
||||
# The OS version matching the desired freebsd-minimal image
|
||||
ARG version=15.0-CURRENT-amd64
|
||||
|
||||
# Select freebsd-minimal as our starting point.
|
||||
FROM localhost/freebsd-minimal:${version}
|
||||
|
||||
# A list of package(s) to install
|
||||
ARG packages
|
||||
|
||||
# Install package management tools. We specify 'FreeBSD' as the repository to
|
||||
# use for downloading pkg since the freebsd-minimal image has both FreeBSD and
|
||||
# FreeBSD-base pkg repo configs installed and FreeBSD-base does not contain the
|
||||
# pkg package.
|
||||
RUN env ASSUME_ALWAYS_YES=yes pkg bootstrap -r FreeBSD && pkg update
|
||||
|
||||
# Install some package(s).
|
||||
RUN pkg install -y ${packages}
|
||||
|
||||
# Clean up and remove package management overhead. We delete downloaded
|
||||
# packages, uninstall pkg and delete the repository metadata downloaded by 'pkg
|
||||
# install'. This retains the record of which packages are installed in the
|
||||
# image.
|
||||
RUN pkg clean -ay && pkg delete -fy pkg && rm -rf /var/db/pkg/repos
|
||||
@@ -0,0 +1,7 @@
|
||||
This example Containerfile shows how to add packages to freebsd-minimal while
|
||||
minimising the package metadata overhead.
|
||||
|
||||
For instance, To build a new image called 'my-new-image:latest' containing the
|
||||
nginx package:
|
||||
|
||||
# podman build --squash --build-arg packages=nginx --tag my-new-image:latest -f Containerfile.pkg
|
||||
Reference in New Issue
Block a user