1*a0165254SDave Cottlehuber# This is an example showing how to extend the freebsd-runtime OCI image by 2d03c82c2SDoug Rabson# installing additional packages while keeping the resulting image as small as 3d03c82c2SDoug Rabson# possible. 4d03c82c2SDoug Rabson 5*a0165254SDave Cottlehuber# The OS version matching the desired freebsd-runtime image 6*a0165254SDave CottlehuberARG version=14.snap 7d03c82c2SDoug Rabson 8*a0165254SDave Cottlehuber# Select freebsd-runtime as our starting point. 9*a0165254SDave CottlehuberFROM localhost/freebsd-runtime:${version} 10d03c82c2SDoug Rabson 11d03c82c2SDoug Rabson# A list of package(s) to install 12d03c82c2SDoug RabsonARG packages 13d03c82c2SDoug Rabson 14d03c82c2SDoug Rabson# Install package management tools. We specify 'FreeBSD' as the repository to 15*a0165254SDave Cottlehuber# use for downloading pkg since the freebsd-runtime image has both FreeBSD and 16d03c82c2SDoug Rabson# FreeBSD-base pkg repo configs installed and FreeBSD-base does not contain the 17d03c82c2SDoug Rabson# pkg package. 18d03c82c2SDoug RabsonRUN env ASSUME_ALWAYS_YES=yes pkg bootstrap -r FreeBSD && pkg update 19d03c82c2SDoug Rabson 20d03c82c2SDoug Rabson# Install some package(s). 21d03c82c2SDoug RabsonRUN pkg install -y ${packages} 22d03c82c2SDoug Rabson 23d03c82c2SDoug Rabson# Clean up and remove package management overhead. We delete downloaded 24d03c82c2SDoug Rabson# packages, uninstall pkg and delete the repository metadata downloaded by 'pkg 25d03c82c2SDoug Rabson# install'. This retains the record of which packages are installed in the 26d03c82c2SDoug Rabson# image. 27d03c82c2SDoug RabsonRUN pkg clean -ay && pkg delete -fy pkg && rm -rf /var/db/pkg/repos 28