Hi
I am running rocky linux in privileged lxc container on Debian 11 host.
If I try to build any rpm I am getting an error from mock
ERROR: Could not create dir /var/lib/mock/rocky+epel-9-x86_64-bootstrap/root/sys/fs/selinux. Error: [Errno 30] Read-only file system: '/var/lib/mock/rocky+epel-9-x86_64-bootstrap/root/sys/fs/selinux'
I guess the reason is that selinux is disabled on Debian. Is there a way to tell mock to work with selinux disabled? I am afraid proper set up of selinux on Debian host would be not simple.
On 12/05/23 01:02, Сергей Спиридонов via rocky wrote:
Hi
I am running rocky linux in privileged lxc container on Debian 11 host.
The issue is you're trying to run a container in a container.
If I try to build any rpm I am getting an error from mock
ERROR: Could not create dir /var/lib/mock/rocky+epel-9-x86_64-bootstrap/root/sys/fs/selinux. Error: [Errno 30] Read-only file system: '/var/lib/mock/rocky+epel-9-x86_64-bootstrap/root/sys/fs/selinux'
I guess the reason is that selinux is disabled on Debian. Is there a way to tell mock to work with selinux disabled? I am afraid proper set up of selinux on Debian host would be not simple.
Mock runs just fine with SELinux disabled.
Mock creates a container to build the package in. Since you're trying to run mock inside a container it means that mock is attempting to create a container inside a container. This tends to create issues, as you've seen. There are people who have successfully done it, but honestly I wouldn't recommend it myself.
My recommendation is to install mock directly in the debian host and use that to build your RPMs.
Peter