When building a fedora 34 based container like:
FROM registry.fedoraproject.org/fedora:34 RUN dnf update -y RUN dnf install -y guestfs-tools
/lib/modules/5.12.9-300.fc34.x86_64/modules.dep is not created in the container:
$ podman run -it --rm quay.io/nirsof/quay-bug ls -lh /lib/modules/5.12.9-300.fc34.x86_64/modules.dep ls: cannot access '/lib/modules/5.12.9-300.fc34.x86_64/modules.dep': No such file or directory
This file is created by running depmod in kernel-core scriptlet. Looking at the logs,
the scriptlet seems to run, but modles.dep is not generated.
When building the same dockerfile locally with podman:
$ podman build -t quay-bug . $ podman run -it --rm quay-bug ls -lh /lib/modules/5.12.9-300.fc34.x86_64/modules.dep -rw-r--r--. 1 root root 141K Jun 14 23:36 /lib/modules/5.12.9-300.fc34.x86_64/modules.dep
modules.dep is generated.
It looks like quay.io build run in special enviroment that cause depmod to be skipped.
Without modules.dep, tool like virt-builder fail to run on the container, since they
assume that modules.dep exist and use in runtime (for reason that are not completely
clear to me).
Normal operation with container built locally:
$ podman run -it --rm --env LIBGUESTFS_BACKEND=direct quay-bug virt-builder cirros-0.3.5 [ 2.3] Downloading: http://builder.libguestfs.org/cirros-0.3.5.xz ####################################################################################################################### 100.0%####################################################################################################################### 100.0% [ 9.1] Planning how to build this image [ 9.1] Uncompressing [ 9.5] Opening the new disk [ 34.0] Setting a random seed [ 34.2] Setting passwords virt-builder: warning: password: using insecure md5 password encryption for guest of type cirros version 0.3. If this is incorrect, use --password-crypto option and file a bug. virt-builder: Setting random password of root to 1Fn19XQdHCWT0TXj [ 39.1] Finishing off Output file: cirros-0.3.5.img Output size: 39.2M Output format: raw Total usable space: 22.2M Free space: 5.3M (23%)
Failed operation with container built in quay.io:
$ podman run -it --rm --env LIBGUESTFS_BACKEND=direct nirsof/quay-bug virt-builder cirros-0.3.5 [ 2.1] Downloading: http://builder.libguestfs.org/cirros-0.3.5.xz ####################################################################################################################### 100.0%####################################################################################################################### 100.0% [ 6.4] Planning how to build this image [ 6.4] Uncompressing [ 6.8] Opening the new disk virt-builder: error: libguestfs error: /usr/bin/supermin exited with error status 1. To see full error messages you may need to enable debugging. Do: export LIBGUESTFS_DEBUG=1 LIBGUESTFS_TRACE=1 and run the command again. For further information, read: http://libguestfs.org/guestfs-faq.1.html#debugging-libguestfs You can also run 'libguestfs-test-tool' and post the *complete* output into a bug report or message to the libguestfs mailing list.If reporting bugs, run virt-builder with debugging enabled and include the complete output: virt-builder -v -x [...]
Workaround:
Build container locally, or run depmod before running virt-builder.
quay.io project:
https://quay.io/repository/nirsof/quay-bug
githubg project with reproduer:
https://github.com/nirs/quay-io-bug/blob/master/Dockerfile
Discussion in libguestfs mailing list:
https://listman.redhat.com/archives/libguestfs/2021-June/msg00115.html