Update Lxc container for host

Hello,

I have hosts Centos 7.6 lxc 3.1 with some guest CentOS 7.6 unprivileged containers.

For the moment I can start/connect/update the containers but I palnned to have lot of containers, and I want to update “automatically” the containers from the host.

I have the CentOS repo mounted on “/media/CentOS”.

With privileged containers I think (?) I can do that “yum --disablerepo=* --enablerepo=c7-media --installroot=/…/container1/rootfs update”

But with my unprivileged containers he owner of the files is “100000.100000”, the “yum… update” create the updated files with “root.root” owner…

I tried to use “lxc-start -n container1 -F – yum --disablerepo=* --enablerepo=c7-media update” but I have the “same” problem, yum is running as “root”.

How can I update offiline and online the containers using yum and the id 100000.100000 ?

Is there a way to execute a command in a running container without network (access console an run command) ?

Best regards.

Francis

Hello,

For a unprivileged container offline finally this work

mount --bind /media/CentOS /…/container1/root/media/CentOS

lxc-start -n container1 -F – yum --disablerepo=* --enablerepo=c7-media update

Not like I say in the previous message yum is running root in the container and 100000 in the host.

Now I have to update an online container with no network with the host.

Best regards.

Francis