varigit / var-host-docker-containers

12 stars 20 forks source link

Questions on the mounted folders from host #1

Closed IngmarPaetzold closed 1 year ago

IngmarPaetzold commented 2 years ago

Hi, a few questions:

nsdrude commented 2 years ago

Hi @IngmarPaetzold ,

Thanks for the suggestions. In general, you are welcome to submit a pull request to add features, like your suggestion to mount some files readonly.

What is the purpose of mounting /usr/src, lib/modules and /linux-kernel? Are these supposed to be the exchange places for sources (in) and modules/kernel (out)? The wiki https://variwiki.com/index.php?title=Docker_Build_Environment states that linux headers need to be installed on the host , since some Yocto versions might need them. Why on the host system? Isn't that contradicting the idea that the guest docker container defines a fixed build environment independent of the host?

The kernel headers are needed for building some older Yocto releases. The headers for the running kernel may not be available in a docker container running an older Ubuntu. It's easiest to install on the host and mount in the container.

Similarly, why is qemu-aarch64-static installed on the host, not in the container? (edit 8th July: I think I understand now after executing a Yocto hands-on example: it just does not matter. qemu is used to test run the image, and that can be done on the host, independent of the build environment Ubuntu version, right?)

For the context of this repository, qemu-aarch64-static is used for chroot when building Debian images. qemu-user-static is required on the host.

Regards, Nate