Error I create a iso manjaro in docker

I am trying to automate the creation of ISO of manjaro using a docker container base from that of official manjaro. Is presenting the following errors, could someone help me?

[root@03228fcd7684 /]# buildiso -f -p kde -b stable
/usr/lib/manjaro-tools/util.sh: line 262: /etc/lsb-release: No such file or directory
/usr/lib/manjaro-tools/util.sh: line 257: /etc/lsb-release: No such file or directory
/usr/lib/manjaro-tools/util.sh: line 267: /etc/lsb-release: No such file or directory
/usr/lib/manjaro-tools/util.sh: line 272: /etc/lsb-release: No such file or directory
 --> Profile: [kde]
 --> detected: user-repos.conf
  -> parsing repo [biglinux] ...
==> Start building [kde]
==> Cleaning up ...
  -> Deleting isoroot [iso] ...
 --> Loading Packages: [Packages-Root] ...
==> Prepare [Base installation] (rootfs)
Create subvolume '/var/lib/manjaro-tools/buildiso/kde/x86_64/rootfs'
 --> mirror: https://manjaro.moson.eu/stable/$repo/$arch
==> Creating install root at /var/lib/manjaro-tools/buildiso/kde/x86_64/rootfs
mount: /var/lib/manjaro-tools/buildiso/kde/x86_64/rootfs: permission denied.
==> ERROR: failed to setup API filesystems in new root
umount: bad usage
Try 'umount --help' for more information.
==> ERROR: Failed to install all packages

from the message it appears you need to install the lsb-release package in your container

If you install manjaro-release package then lsb-release error message disappears.

$ buildpkg -cw
 --> Loading compiler settings: x86_64
==> Cleaning up ...
  -> Cleaning [/var/cache/manjaro-tools/pkg/stable/x86_64]
  -> Cleaning [source files]
==> Cleaning chroot for [stable] (x86_64)...
==> Creating chroot for [stable] (x86_64)...
 --> mirror: https://manjaro.moson.eu/stable/$repo/$arch
==> Creating install root at /var/lib/manjaro-tools/buildpkg/stable/x86_64/root
mount: /var/lib/manjaro-tools/buildpkg/stable/x86_64/root/dev: permission denied.
==> ERROR: failed to setup API filesystems in new root
==> ERROR: Failed to install all packages
==> ERROR: Aborting...

If you call it with bash -x, it goes to setarch binary with mkchroot arg

$ setarch x86_64 mkchroot -C /usr/share/manjaro-tools/pacman-default.conf -M /tmp/manjaro-tools/makepkg-x86_64.conf -S /tmp/manjaro-tools/pacman-mirrors-stable.conf -B https://manjaro.moson.eu/stable -L /var/lib/manjaro-tools/buildpkg/stable/x86_64/root base-devel
 --> mirror: https://manjaro.moson.eu/stable/$repo/$arch
==> Creating install root at /var/lib/manjaro-tools/buildpkg/stable/x86_64/root
mount: /var/lib/manjaro-tools/buildpkg/stable/x86_64/root/dev: permission denied.
==> ERROR: failed to setup API filesystems in new root
==> ERROR: Failed to install all packages

Then you can continue with bash -x to you continue to basestrap which does

mount udev /var/lib/manjaro-tools/buildpkg/stable/x86_64/root/dev -t devtmpfs -o mode=0755,nosuid

The question is how to reconfigure docker to run container with enough priviledges or how to change basestrap to be working without extra permissions.

In my case helped to run container in as root with --privileded flag

Running like this is very insecure for the system. I managed to run with the podman, but I’m still having an error creating the iso, if anyone can help !!

Error:

hint: use `pacman-mirrors` to generate and update your pacman mirrorlist.
(16/17) Updating the info directory file...
(17/17) Updating the MIME type database...
 --> Using build locales ...
 --> Setting mirrorlist branch: stable
Generating locales...
  en_US.UTF-8... done
Generation complete.
 --> Restoring [/var/lib/manjaro-tools/buildiso/xfce/x86_64/rootfs/etc/pacman.conf] ...
  -> Configuring lsb-release
  -> Cleaning [rootfs]
==> Done [Base installation] (rootfs)
 --> Loading Packages: [Packages-Desktop] ...
==> Prepare [Desktop installation] (desktopfs)
 --> overlayfs mount: [/var/lib/manjaro-tools/buildiso/xfce/x86_64/desktopfs]
mount: /var/lib/manjaro-tools/buildiso/xfce/x86_64/desktopfs: wrong fs type, bad option, bad superblock on overlay, missing codepage or helper program, or other error.
==> ERROR: A failure occurred in make_image_desktop().
    Aborting...

Information here to replicate the error: It is not possible to mount /dev even with root · Issue #10133 · containers/podman · GitHub