Yum/rpm not suitable for overlayfs?

Issues related to applications and software problems
Post Reply
CHW
Posts: 2
Joined: 2018/08/05 18:28:25

Yum/rpm not suitable for overlayfs?

Post by CHW » 2018/08/05 18:29:48

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.

Mike_Rochefort
Posts: 215
Joined: 2016/03/16 02:34:19

Re: Yum/rpm not suitable for overlayfs?

Post by Mike_Rochefort » 2018/08/11 21:07:10

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
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

CHW
Posts: 2
Joined: 2018/08/05 18:28:25

Re: Yum/rpm not suitable for overlayfs?

Post by CHW » 2018/08/12 21:21:49

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:

Code: Select all

mkdir -p base overlays/test workdirs/test mounts/test
Install base, remove password:

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
Mount overlay:

Code: Select all

sudo mount -t overlay overlay -o lowerdir=base,upperdir=overlays/test,workdir=workdirs/test mounts/test
Boot overlay, install a package, unmount overlay:

Code: Select all

sudo systemd-nspawn -bD mounts/test
yum install vim-minimal
sudo umount /mount/test
Now wait until there is a package update, install said update at the base:

Code: Select all

sudo systemd-nspawn -bD base
yum check-update && yum update -y
Mount overlay, boot and check for updates:

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
The last command will show the updated package again, although base is already up to date.

Post Reply