Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

document dnf bootstrap #321

Merged
merged 1 commit into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 16 additions & 10 deletions appendix.rst
Original file line number Diff line number Diff line change
Expand Up @@ -804,8 +804,8 @@ the new image during bootstrap.

.. _build-yum:

``yum`` bootstrap agent
=======================
``yum`` or ``dnf`` bootstrap agent
==================================

.. _sec:build-yum:

Expand All @@ -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
Expand All @@ -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.

Expand Down Expand Up @@ -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:

Expand Down
4 changes: 2 additions & 2 deletions definition_files.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion docker_and_oci.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions environment_and_metadata.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion fakeroot.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down