Skip to content

Fix DNF-based ImageBuilder containers and add build and test scripts - #59

Open
erminpour wants to merge 6 commits into
OpenCHAMI:mainfrom
erminpour:victore-image-builder
Open

Fix DNF-based ImageBuilder containers and add build and test scripts#59
erminpour wants to merge 6 commits into
OpenCHAMI:mainfrom
erminpour:victore-image-builder

Conversation

@erminpour

Copy link
Copy Markdown

This PR fixes the DNF-based ImageBuilder container images and adds scripts for building
and testing them.

The standard DNF and minimal images had issues with their Buildah/rootless configuration.
This updates the Dockerfiles so the containers are configured correctly and removes the
runtime setup that was previously handled by entrypoint.sh.

Changes:

  • Fix the rootless Buildah configuration in the DNF image.
  • Fix the rootless Buildah configuration in the EL9 and minimal DNF images.
  • Run the containers as the builder user by default.
  • Configure the required subordinate UID/GID mappings
  • Configure newuidmap/newgidmap capabilities.
  • Remove the now-unnecessary entrypoint.sh.
  • Clean up duplicate fuse-overlayfs configuration
  • Remove unnecessary shadow-utils restore.
  • Fix Python dependency installation in the minimal image.
  • Add scripts/build-dnf-images.sh to build all three DNF-based images.
  • Add tests/test-image-builder-containers.sh with smoke tests for the container images.

Testing:

The new test script checks all three DNF-based images and verifies:

  • Container startup and ImageBuilder --help
  • builder user configuration
  • Python, pip, and Ansible
  • Buildah
  • newuidmap and newgidmap
  • Subordinate UID/GID mappings
  • Rootless Buildah user namespaces

The goal is to make the DNF-based container builds reproducible and provide a simple way
to build and verify the resulting images.

Victor Erminpour added 6 commits September 2, 2026 00:03
Add 'build-dnf-images.sh' to build the DNF-based ImageBuilder
container images under 'dockerfiles/dnf/':

Dockerfile          (AlmaLinux 8.8)
Dockerfile.el9      (AlmaLinux 9.6)
Dockerfile.minimal  (AlmaLinux 8-minimal)

Signed-off-by: Victor Erminpour <victor@erminpour.com>
Add 'test-image-builder-containers.sh' to verify the DNF-based
ImageBuilder container images provide the required Python, Ansible,
Buildah and rootless user namespace configuration.

The tests cover:
- Container startup
- The builder user
- Python and pip
- Buildah
- 'newuidmap'/'newgidmap'
- Subordinate UID/GID mappings
- Rootless Buildah user namespaces

Signed-off-by: Victor Erminpour <victor@erminpour.com>
Update the DNF-based ImageBuilder container to run Buildah
rootlessly as the builder user.

- Configure subordinate UID/GID mappings for builder
- Grant newuidmap and newgidmap the required capabilities
- Remove the unnecessary shadow-utils RPM restore
- Run the container as builder by default
- Set the builder working directory
- Use Buildah unshare as the container entrypoint
- Suppress pip's root-user warning during dependency installation
- Clean up duplicate fuse-overlayfs configuration

Signed-off-by: Victor Erminpour <victor@erminpour.com>
Update the EL9 DNF-based ImageBuilder container to align its
rootless Buildah configuration with the standard DNF image.

- Remove the unnecessary shadow-utils RPM restore
- Suppress pip's root-user warning during dependency installation
- Clean up duplicate fuse-overlayfs configuration
- Fix shell formatting in the Buildah capability setup
- Preserve subordinate UID/GID mappings for rootless builds

Signed-off-by: Victor Erminpour <victor@erminpour.com>
Update the minimal DNF-based ImageBuilder container to support
rootless Buildah execution and align its configuration with the
other DNF-based images.

- Configure subordinate UID/GID mappings for builder
- Grant newuidmap and newgidmap the required capabilities
- Install ImageBuilder Python dependencies
- Suppress pip root-user warnings during installation
- Run the container as the builder user by default
- Set the builder working directory
- Use Buildah unshare as the container entrypoint
- Remove the obsolete manual passwd/group configuration

Signed-off-by: Victor Erminpour <victor@erminpour.com>
Remove 'entrypoint.sh' which is no longer required now that the
ImageBuilder container configures the builder user and rootless
Buildah environment directly in the Dockerfiles.

The container now uses Buildah unshare as its entrypoint and no
longer needs runtime configuration of subordinate UID/GID mappings
or the builder home directory.

Signed-off-by: Victor Erminpour <victor@erminpour.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant