weldr / lorax

Tools for creating images, including the Anaconda boot.iso, live disk images, iso's, and filesystem images.
GNU General Public License v2.0
294 stars 157 forks source link

Issues with Creating ISOs with Lorax inside a privileged Docker Container #1383

Closed noelmiller closed 5 months ago

noelmiller commented 7 months ago

Hi There!

I am currently using Fedora Kinoite 39 and I have been having issues running a docker container that was created that has Lorax.

The problem for us is documented here: https://github.com/ublue-os/isogenerator/issues/22

Containerfile is here: https://github.com/ublue-os/isogenerator/blob/main/Containerfile

Makefile that runs lorax is here: https://github.com/ublue-os/isogenerator/blob/main/Makefile

Example command to use: docker run --privileged --volume .:/isogenerator/output ghcr.io/ublue-os/isogenerator

I am running our container we built using privileged mode and for whatever reason, I am required to run the container twice before it will spit out an image for me. It seems to be related to /dev/loop0 not being there on the first attempt and then subsequent attempts, /dev/loop0 is available on the host and it will finish creating the ISO.

The issue does not occur when running on Ubuntu LTS, only when running on my Fedora Kinoite 39 machine. I'm unsure if this is a Fedora problem, a problem with Docker, or an issue with Lorax, so I was hoping I could rule one of the three out!

Thanks,

Noel

bcl commented 6 months ago

Sorry for the late response. There is a similar issue with loop devices when using mock, they need to be created manually and are shared with the host which can cause you to unexpectedly run out of them. My guess is that Ubuntu has a /dev in the container that isn't as minimal as the one with Fedora. It looks like you have a mknod in your entrypoint now. Be careful with that, if loop0 is used on the host already then you may not get the results you expect, or it will fail with an error about not being able to find a loop device. I can't remember if also creating /dev/loop-control helped, it has been a while since I've used lorax like this but you may want to look into that as well.

jkonecny12 commented 5 months ago

Just FYI this is script we are using in Anaconda container to build custom ISOs

https://github.com/rhinstaller/anaconda/blob/master/dockerfile%2Fanaconda-iso-creator%2Florax-build#L27

noelmiller commented 5 months ago

Sorry for the late reply, yes, we were able to solve this by using mknod. This can be closed.