Hi everyone.
I've setup a base systemd-nspawn container and a few different overlays on top so I can switch between PHP versions easily.
Works great, expect for this:
If I update the base container while it's not mounted yum on the overlays does not get the memo.
Now mounting the overlay on top and yum will still want to update the same packages, which are already updated at the base, resulting in a duplicate on the overlay.
This defeats the whole purpose of having a base container in the first place.
As far as I understand it it's a RPMdb issue.
Is there some workaround to get this to work or is yum/rpm just not suitable for this king of setup?
BTW: The exact same setup works great with pacman on archlinux.
Yum/rpm not suitable for overlayfs?
-
- Posts: 215
- Joined: 2016/03/16 02:34:19
Re: Yum/rpm not suitable for overlayfs?
I’ve been messing with containers (for HPC) and in doing a bit of research most issues with yum and overlay seem to be fixable by installing yum-plugin-ovl in the container. Not sure if that’ll fix the issue you’re having but it might be a start.
Cheers,
Mike
Cheers,
Mike
Solution Architect @RedHat | RHCE
Former SysAdmin @BlueSkyStudios and @Pixar
Feature animation and VFX enthusiast
--
Report CentOS Stream 8 bugs: https://da.gd/c8s-bugs
Report CentOS Stream 9 bugs: https://da.gd/c9s-bugs
Former SysAdmin @BlueSkyStudios and @Pixar
Feature animation and VFX enthusiast
--
Report CentOS Stream 8 bugs: https://da.gd/c8s-bugs
Report CentOS Stream 9 bugs: https://da.gd/c9s-bugs
Re: Yum/rpm not suitable for overlayfs?
I forgot to mention it, but it's already installed.
I've also tried the latest Fedora, just to check if it's a yum issue.
It's not, dnf behaves the exact same way:
The initial copy-up is performed after which the RPMDB at the base is completely ignored.
Here is a basic setup to reproduce this in case anyone is interested:
Create dirs:
Install base, remove password:
Mount overlay:
Boot overlay, install a package, unmount overlay:
Now wait until there is a package update, install said update at the base:
Mount overlay, boot and check for updates:
The last command will show the updated package again, although base is already up to date.
I've also tried the latest Fedora, just to check if it's a yum issue.
It's not, dnf behaves the exact same way:
The initial copy-up is performed after which the RPMDB at the base is completely ignored.
Here is a basic setup to reproduce this in case anyone is interested:
Create dirs:
Code: Select all
mkdir -p base overlays/test workdirs/test mounts/test
Code: Select all
sudo yum --installroot=/home/admin/base --releasever=7 install systemd passwd yum centos-release hostname yum-plugin-ovl
sudo systemd-nspawn -D base/ passwd -d root
Code: Select all
sudo mount -t overlay overlay -o lowerdir=base,upperdir=overlays/test,workdir=workdirs/test mounts/test
Code: Select all
sudo systemd-nspawn -bD mounts/test
yum install vim-minimal
sudo umount /mount/test
Code: Select all
sudo systemd-nspawn -bD base
yum check-update && yum update -y
Code: Select all
sudo mount -t overlay overlay -o lowerdir=base,upperdir=overlays/test,workdir=workdirs/test mounts/test
sudo systemd-nspawn -bD mounts/test
yum check-update