Skip to content

fedora-qcow2: derived containers#14

Merged
thozza merged 3 commits intomainfrom
fedora-qcow2-1
Mar 31, 2026
Merged

fedora-qcow2: derived containers#14
thozza merged 3 commits intomainfrom
fedora-qcow2-1

Conversation

@lzap
Copy link
Copy Markdown
Collaborator

@lzap lzap commented Mar 20, 2026

This adds Fedora qcow2 derived containerfile. I wanted to start small, this is the most simple one. This PR is meant for discussion, I am making several assumptions which might be completely wrong.

Image definitions

I used the qcow2 and/or cloud-qcow2 image definitions when writing those Containerfiles as inspiration and my workflow was dropping anything that is not needed or not relevant for bootc.

Assumption: users of the qcow2 image use cockpit-machines, libvirt or qemu/kvm directly. Although it is technically possible to use cloud-init in these environments, users must do additional configuration to achieve that (network endpoint, mount an ISO with seed info). Since image builder can actually help to set up users, passwords and ssh-keys, I am leaving cloud-init out of this.

I reviewed packages from both definitions and came up with the list that includes guest agents group plus some tools that might be required for storage/filesystems.

Dropped packages

Fedora

  • "@server-product-environment"
  • "@domain-client"
  • "glibc-all-langpacks"

EL10

  • "@core"
  • "chrony"
  • "cloud-init"
  • "cloud-utils-growpart"
  • "cockpit-system"
  • "cockpit-ws"
  • "dnf-utils"
  • "dosfstools"
  • "nfs-utils"
  • "oddjob"
  • "oddjob-mkhomedir"
  • "psmisc"
  • "python3-jsonschema"
  • "qemu-guest-agent"
  • "redhat-release"
  • "redhat-release-eula"
  • "rsync"
  • "system-reinstall-bootc"
  • "tar"
  • "tuned"
  • "tcpdump"

EL9

  • "@core"
  • "authselect-compat"
  • "chrony"
  • "cloud-init"
  • "cloud-utils-growpart"
  • "cockpit-system"
  • "cockpit-ws"
  • "dnf-utils"
  • "dosfstools"
  • "nfs-utils"
  • "oddjob"
  • "oddjob-mkhomedir"
  • "psmisc"
  • "python3-jsonschema"
  • "qemu-guest-agent"
  • "redhat-release"
  • "redhat-release-eula"
  • "rsync"
  • "tar"
  • "tuned"
  • "tcpdump"

Kernel command line and bootloader

These image definitions do set up kernel command line with focus on console and serial console. This is very useful in cockpit where console is fully native. Therefore I am including those arguments, but leaving out the speed which is not needed in virtualized environments.

I noticed that in other cloud environments we do also set grub2 kernel command line too. Shall we do that here?

GRUB_TERMINAL="serial console"
GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"

Also, in other images we disable recovery, I did not find this in our distro defs either, so left this out:

GRUB_DISABLE_RECOVERY="true"

Personally, I would love a shorter timeout but I think we should stick with the default value.

GRUB_TIMEOUT=4

Interface naming in EL9

I am not including the kernel command line option net.ifnames=0 for EL9 image.

Git repo organization

Now, few practical things. I am trying to keep as much files as possible out of the containerfile. I noticed that the pattern used in the bootc world is to have a single directory and have the COPY verb to do all the work, it copies recursively by default.

But we will need separate directories per version (when it drifts) and architecture so I created:

fedora-qcow2-amd64
└── usr
    └── lib
        └── bootc
            └── kargs.d
                └── 50-kargs-x86_64.toml
fedora-qcow2-arm64
└── usr
    └── lib
        └── bootc
            └── kargs.d
                └── 50-kargs-aarch64.toml

The verb actually automatically enforces root:root owner, unless specified otherwise via --owner, it also respects permissions but applies umask. Generally speaking, it should work and executable files will be kept.

Testing the images

The image boots fine, serial console works nicely in libvirt, I cannot see or control grub via serial console because that is currently not configured.

Initial setup - DROPPED

But, the initial-setup never disappears until it is confirmed in TUI/GUI. I think it does not make sense to have it in derived containers, users can add it if they want. Therefore I am removing initial-setup.

1) [ ] Language settings                 2) [x] Time settings
       (Language is not set.)                   (America/New_York timezone)
3) [x] Network configuration             4) [!] Root password
       (Connected: enp1s0)                      (Root account is disabled)
5) [!] User creation
       (No user will be created)

RHSM + Lightspeed

Works fine:

+-------------------------------------------+
   System Status Details
+-------------------------------------------+
Overall Status: Not registered

bash-5.2# rhc connect --activation-key xxxx --organization xxxx
Connecting localhost.localdomain to Red Hat.
This might take a few seconds.

Features preferences: [✓]content, [✓]analytics, [✓]remote-management

 [✓] Connected to Red Hat Subscription Management
  [✓] Content ... Red Hat repository file generated
  [✓] Analytics ... Connected to Red Hat Lightspeed (formerly Insights)
  [✓] Remote Management ... Activated the yggdrasil service

Successfully connected to Red Hat!

Manage your connected systems: https://red.ht/connector

tuned - DROPPED

Is disabled by default, recognizes guest automatically:

bash-5.2# tuned-adm active
Current active profile: virtual-guest

@supakeen
Copy link
Copy Markdown
Member

If it works this is fine; we're not purporting to be any specific Fedora variant and it all seems in-line with what I'd expect.

Let's not touch anything grub related to be honest; it shouldn't really be necessary and it should be managed by bootupd (if not now; then eventually?).

croissanne
croissanne previously approved these changes Mar 23, 2026
Copy link
Copy Markdown
Member

@croissanne croissanne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm afaik!

@lzap
Copy link
Copy Markdown
Collaborator Author

lzap commented Mar 23, 2026

I am currently testing the image, but since this is new and sets the bar for other containerfiles, please give this a read @achilleas-k and @thozza (and anyone interested).

@lzap lzap force-pushed the fedora-qcow2-1 branch 2 times, most recently from 25f6b72 to d722064 Compare March 23, 2026 18:14
@lzap
Copy link
Copy Markdown
Collaborator Author

lzap commented Mar 23, 2026

So the initial-setup did not work as I assumed, I thought it disappears after first reboot but this is persistent until user confirms or cancels it in TUI/GUI. I think this is way too much for generic derived bootc images, so I am removing this. Also fixed one typo and elaborated the description.

@lzap lzap changed the title fedora-qcow2: initial version fedora-qcow2: derived containers Mar 24, 2026
@lzap lzap marked this pull request as draft March 24, 2026 11:52
Comment thread containerfiles/Containerfile.fedora-qcow2 Outdated
Comment thread containerfiles/Containerfile.fedora-qcow2 Outdated
Comment thread containerfiles/Containerfile.fedora-qcow2 Outdated
Comment thread containerfiles/Containerfile.el10-qcow2 Outdated
Comment thread containerfiles/Containerfile.el10-qcow2 Outdated
Comment thread rhel-10.1-qcow2
Comment thread containerfiles/Containerfile.el10-qcow2 Outdated
@lzap lzap force-pushed the fedora-qcow2-1 branch 2 times, most recently from 81f7132 to 96b34b0 Compare March 24, 2026 17:44
@lzap
Copy link
Copy Markdown
Collaborator Author

lzap commented Mar 24, 2026

  • Broken down into directories separated by architecture, introduced the standard TARGETARCH variable for that
  • Reviewed all packages which are installed and basically dropped 50% of all the lines :-)

Thanks @supakeen and @thozza

Comment thread containerfiles/fedora-qcow2-amd64/usr/lib/bootc/kargs.d/50-kargs-x86_64.toml Outdated
Comment thread containerfiles/Containerfile.el10-qcow2 Outdated
@lzap
Copy link
Copy Markdown
Collaborator Author

lzap commented Mar 25, 2026

Ready for final review. I rebased on top of Konflux pipeline cleanup, we are aiming to do all builds in Konflux. For this reason, the naming convention changed to match Konflux project structure. Please re-read the description I updated it with some findings during my boot testing.

I realized that I installed many packages which were already part of the base image, so container files are now much lighter.

Also, @supakeen raised a concern about tuned so please chip in if you prefer not to ship this at all. Adding it could make it hard for people who would prefer not using it, on the other hand, bootc base image already contains a ton of things.

containerfiles/
├── el10-qcow2-amd64
│   └── usr
│       └── lib
│           └── bootc
│               └── kargs.d
│                   └── 50-kargs-x86_64.toml
├── el10-qcow2-arm64
│   └── usr
│       └── lib
│           └── bootc
│               └── kargs.d
│                   └── 50-kargs-aarch64.toml
├── el9-qcow2-amd64
│   └── usr
│       └── lib
│           └── bootc
│               └── kargs.d
│                   └── 50-kargs-x86_64.toml
├── el9-qcow2-arm64
│   └── usr
│       └── lib
│           └── bootc
│               └── kargs.d
│                   └── 50-kargs-aarch64.toml
├── fedora-qcow2-amd64
│   └── usr
│       └── lib
│           └── bootc
│               └── kargs.d
│                   └── 50-kargs-x86_64.toml
├── fedora-qcow2-arm64
│   └── usr
│       └── lib
│           └── bootc
│               └── kargs.d
│                   └── 50-kargs-aarch64.toml
├── f43-qcow2
├── rhel-10.1-qcow2
├── stream10-qcow2
└── stream9-qcow2

Because the files do not have Containerfile prefix going forward, I added modelines:

# vim: set ft=dockerfile:
# -*- mode: dockerfile-mode -*-
# code: language=dockerfile insertSpaces=true tabSize=4

This is for easier editing, unfortunately .editorconfig does not allow for changing syntax schemes.

@lzap lzap marked this pull request as ready for review March 26, 2026 12:26
croissanne
croissanne previously approved these changes Mar 26, 2026
Copy link
Copy Markdown
Member

@croissanne croissanne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@lzap lzap force-pushed the fedora-qcow2-1 branch 2 times, most recently from 79ca734 to 667ee34 Compare March 27, 2026 12:44
@lzap
Copy link
Copy Markdown
Collaborator Author

lzap commented Mar 27, 2026

One little change, forgot to update COPY Containerfile /root/Containerfile lines, the containerfiles are no longer generated but fully static. The correct line is COPY Containerfile /root/f43-qcow2 etc.

Comment thread .tekton/rhel-10-1-qcow2-pull-request.yaml
Comment thread .tekton/rhel-10-1-qcow2-push.yaml
@lzap lzap force-pushed the fedora-qcow2-1 branch 3 times, most recently from 7843f2c to 4f54bff Compare March 30, 2026 12:19
@lzap
Copy link
Copy Markdown
Collaborator Author

lzap commented Mar 30, 2026

Please re-review I am also moving the file from containerfiles/ to the root since now we build in Konflux things are more simple. @supakeen @thozza

ondrejbudai
ondrejbudai previously approved these changes Mar 30, 2026
Copy link
Copy Markdown
Member

@ondrejbudai ondrejbudai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks simple and straightforward, we can always tweak it later as we add more image types and versions.

Copy link
Copy Markdown
Member

@thozza thozza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, this looks good, but I have the following comments:

  1. The first commit says "move container files", but it just deletes them AFAICT, so the commit message is wrong.
  2. I'm not sure where are the kernel args coming from for qcow2, but they don't seem to match our image definitions, which would be desirable.
  3. WRT tuned, my position is that it is probably desirable to have it installed by default, but I feel like this should be part of the base bootc container image. My hope that our derived containerfiles will add just the bare minimum to make the system integrate nicely in the target environment, but they do not "finalize" the expected RHEL experience by installing bunch of additional packages. From my PoV, this just adds unwanted maintenance load on us and we should prevent it. Basically say that if tuned should be installed on RHEL image mode qcow2, then it should be in the base container that it is built from.... 🤷

Comment thread el10-qcow2-amd64/usr/lib/bootc/kargs.d/50-kargs-x86_64.toml
Comment thread el10-qcow2-arm64/usr/lib/bootc/kargs.d/50-kargs-aarch64.toml Outdated
@lzap
Copy link
Copy Markdown
Collaborator Author

lzap commented Mar 31, 2026

Addressed all @thozza concerns. Reworded the first commit, dropped tuned and fixed kernel command line options.

While we do not set serial console for arm64 in our distrodefs, I think we should since we do this for intel and is quite useful for virtualized environments to have out of box. So I propose to have it here and I can fix that in distrodef too perhaps. We have them for other image types but not for qcow2.

Copy link
Copy Markdown
Member

@thozza thozza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, and sorry for not following that discussion, how will initial setup work? Is cloud-init part of the base image?

@thozza thozza dismissed croissanne’s stale review March 31, 2026 18:34

The requested changes were addressed AFAICT.

@thozza thozza merged commit 82b4cbc into main Mar 31, 2026
2 checks passed
@lzap
Copy link
Copy Markdown
Collaborator Author

lzap commented Apr 1, 2026

Out of curiosity, and sorry for not following that discussion, how will initial setup work? Is cloud-init part of the base image?

There is neither cloud-init nor initial-setup, image-builder creates users from a blueprint and users are supposed to boot qcow2 image directly (so no root expansion is needed). Cloud-init would not work in KVM environment anyway unless a network endpoint or seed ISO file is attached.

@lzap lzap deleted the fedora-qcow2-1 branch April 1, 2026 08:56
@thozza
Copy link
Copy Markdown
Member

thozza commented Apr 1, 2026

There is neither cloud-init nor initial-setup, image-builder creates users from a blueprint and users are supposed to boot qcow2 image directly (so no root expansion is needed). Cloud-init would not work in KVM environment anyway unless a network endpoint or seed ISO file is attached.

Well, cloud-init is included by default in our qcow2 package-based images and I consider it part of the platform-specific enablement. By default, we do not require any users to be added to the image as a customization in order to produce a usable image. So my suggestion would be to add it to the qcow2.

@lzap
Copy link
Copy Markdown
Collaborator Author

lzap commented Apr 1, 2026

Well, cloud-init is included by default in our qcow2 package-based images

The same can be said about tuned which is in my eyes more important to be present than cloud-init which is 9/10 not useful in KVM environment because users need to do extra work in order to leverage it. Yet, we have decided to exclude tuned, which works "out of box" for everyone.

The idea of having those derived containers as thing as possible grew on me and my suggestion is: let's wait until someone asks for cloud-init or initial-setup for qcow2.

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.

5 participants