-
Notifications
You must be signed in to change notification settings - Fork 29
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
Changes to support ostree bootable containers #328
base: master
Are you sure you want to change the base?
Conversation
@cbouchar - fyi. |
Red Hat's Atomic OS is a read-only filesystem that uses ostree underneath. Installing packages using dnf does not work. Instead use the native package installer 'rpm-ostree install' if an ostree booted filesystem is detected. Utilize various options -y: always install --apply-live: apply changes now instead of waiting for a reboot --idempotent: do not error if package is already installed --allow-inactive: do not error if package is already committed Also include detection of CentOS Stream and leverage the same plugins. Signed-off-by: Don Zickus <[email protected]>
Red Hat's ostree is a read-only filesystem that maps everything under /usr. The only persistent data is mapped under /etc and /var. To support /mnt, ostree mapped the directory under /var/mnt and created it at first-boot using systemd-tmpfiles. The directory /var/mnt does not exist at container creation time and thus restraint-rhts package fails to create /mnt/scratchspace and /mnt/testarea at install time. Switch these directories to systemd-tmpfiles that are created on boot. This resolves the problem and allows the packages to be installed during the container build or anaconda kickstart. Signed-off-by: Don Zickus <[email protected]>
@cbouchar PTAL |
Playing with this, there is one other thing in the spec file that doesn't work with bootc:
This creates a directory in /var/lib, but according to https://containers.github.io/bootc/filesystem.html#var contents in /var/lib is never updated after the very first bootc installation, ie installing restraint into a modified image and switching to that will not work as this directory is missing; iiuc this can be handled via systemd-tmpfiles as used above as well |
@mh21 - I am testing using StateDirectory=restraint in the systemd service file. Then moving /var/lib/restraint/install_config to /usr/share/rhts/install_config then cp'ing install config to /var/lib/restraint/install_config during %post rhts. I think this is how it is supposed to work sort of??? |
Is it better to split RSTRNT_PKG_ARGS=${RSTRNT_PKG_ARGS:--y --apply-live --idempotent --allow-inactive} into |
Ostree has bootable containers with a read-only filesystem. This filesystem doesn't support dnf install nor current restraint directory layout and needs a few tweaks. With these changes, restraint should work out of the box with bootable containers over ssh.
Signed-off-by: Don Zickus [email protected]