From 1b53ae2a65ff1364582a7a506db6d58d94c9354a Mon Sep 17 00:00:00 2001 From: jason yang Date: Thu, 13 Feb 2025 09:04:51 +0900 Subject: [PATCH] document dnf bootstrap Signed-off-by: jason yang --- appendix.rst | 26 ++++++++++++++++---------- definition_files.rst | 4 ++-- docker_and_oci.rst | 3 ++- environment_and_metadata.rst | 4 ++-- fakeroot.rst | 2 +- 5 files changed, 23 insertions(+), 16 deletions(-) diff --git a/appendix.rst b/appendix.rst index f607dbfd..0815ecba 100755 --- a/appendix.rst +++ b/appendix.rst @@ -804,8 +804,8 @@ the new image during bootstrap. .. _build-yum: -``yum`` bootstrap agent -======================= +``yum`` or ``dnf`` bootstrap agent +================================== .. _sec:build-yum: @@ -815,7 +815,7 @@ container from a mirror URI based on yum or dnf. Overview -------- -Use the ``yum`` module to specify a base for a RHEL-like container. +Use the ``yum`` or ``dnf`` module to specify a base for a RHEL-like container. You must also specify the URI for the mirror you would like to use. Keywords @@ -825,6 +825,12 @@ Keywords Bootstrap: yum +or + +.. code:: {command} + + Bootstrap: dnf + The Bootstrap keyword is always mandatory. It describes the bootstrap module to use. @@ -852,28 +858,28 @@ The Include keyword is optional. It allows you to install additional packages into the core operating system. It is a best practice to supply only the bare essentials such that the ``%post`` section has what it needs to properly complete the build. One common package you may want to -install when using the ``yum`` build module is YUM or DNF itself. +install when using the ``yum`` or ``dnf`` build module is YUM or DNF itself. Notes ----- -There is a major limitation with using YUM to bootstrap a container. The +There is a major limitation with using YUM/DNF to bootstrap a container. The RPM database that exists within the container will be created using the RPM library and Berkeley DB implementation that exists on the host system. If the RPM implementation inside the container is not compatible -with the RPM database that was used to create the container, RPM and YUM +with the RPM database that was used to create the container, RPM and YUM/DNF commands inside the container may fail. This issue can be easily demonstrated by bootstrapping an older RHEL compatible image by a newer one (e.g. bootstrap a RHEL 8 container from a RHEL 9 host). -In order to use the ``yum`` build module, you must have ``yum`` -installed on your system. It may seem counter-intuitive to install YUM -on a system that uses a different package manager, but you can do so. +In order to use the ``yum`` or ``dnf`` build module, you must have ``yum`` +or ``dnf`` installed on your system. It may seem counter-intuitive to install YUM +or DNF on a system that uses a different package manager, but you can do so. For instance, on Ubuntu you can install it like so: .. code:: - $ sudo apt-get update && sudo apt-get install yum + $ sudo apt-get update && sudo apt-get install dnf .. _build-debootstrap: diff --git a/definition_files.rst b/definition_files.rst index c8f43125..840388fc 100755 --- a/definition_files.rst +++ b/definition_files.rst @@ -70,12 +70,12 @@ that uses the ``From`` keyword to build a Debian container: Bootstrap: docker From: debian:10 -A def file that uses an official mirror to install CentOS 7 might look +A def file that uses an official mirror to install AlmaLinux 9 might look like this: .. code:: {command} - Bootstrap: yum + Bootstrap: dnf OSVersion: 9 MirrorURL: http://repo.almalinux.org/almalinux/%{OSVERSION}/BaseOS/x86_64/os Include: dnf diff --git a/docker_and_oci.rst b/docker_and_oci.rst index d8e01669..71890768 100755 --- a/docker_and_oci.rst +++ b/docker_and_oci.rst @@ -1282,7 +1282,8 @@ Section Description Section Description | are supported, e.g. | ``library``, ``docker``, | ``http``, ``shub``, - | ``yum``, ``debootstrap``. + | ``yum``, ``dnf``, + | ``debootstrap``. ``From:`` | Specifies the base ``FROM`` | Creates a layer from | image from which to the | the specified docker image. diff --git a/environment_and_metadata.rst b/environment_and_metadata.rst index 34608037..13e5cc46 100644 --- a/environment_and_metadata.rst +++ b/environment_and_metadata.rst @@ -67,9 +67,9 @@ Environment From a Base Image When you build a container with {Project} you might *bootstrap* from a library or Docker image, or using Linux distribution bootstrap tools -such as ``debootstrap``, ``yum`` etc. +such as ``debootstrap``, ``yum``, ``dnf`` etc. -When using ``debootstrap``, ``yum`` etc. you are starting from a fresh +When using ``debootstrap``, ``yum``, ``dnf`` etc. you are starting from a fresh install of a Linux distribution into your container. No specific environment variables will be set. If you are using a ``library`` or ``Docker`` source then you may inherit environment variables from your diff --git a/fakeroot.rst b/fakeroot.rst index 35d7b0d6..13e71f1d 100644 --- a/fakeroot.rst +++ b/fakeroot.rst @@ -181,7 +181,7 @@ Some bootstrap methods that require creation of block devices (like ``/dev/null``) may not always work correctly with "fake root". With the rootles mode "fake root", {Project} uses seccomp filters to give programs the illusion that block device creation succeeded. -This appears to work with ``yum`` bootstraps and *may* work with other +This appears to work with ``yum`` or ``dnf`` bootstraps and *may* work with other bootstrap methods, although ``debootstrap`` is known to not work. If only the fakeroot command is used for "fake root" mode (because no