Yoe Build Container
A Linux container for production OE/Yocto builds.
OE builds require a small number of dependencies that must be installed. This is not a huge deal, but can take 30-60 minutes to figure out what they all are and wait for them to install. This container gives you everything you need.
Additionally, production builds require a known build environment where package versions are
not changing. Using a container for OE builds allows team members to use whatever Linux distro
they want on their workstations, but all have access to a common build environment for OE builds.
For long product life cycles, you often find the old OE/Yocto versions are not compatible with new Linux distributions, so this container gives you an easy way to keep building as you update your Host OS.
See https://github.com/YoeDistro/yoe-distro/blob/master/envsetup.sh#L391 for an example of how to use this container in an OE build.
Some notes on the above:
- The build directory is mapped into the container at the same location as the host. This keeps things simple and ensures that any paths in generated config files are the same in the container, and on the host.
- Host ssh keys are mapped into container so that we can clone project git repos using ssh authentication.
- Host gitconfig is mapped into the container as well in case the build requires any git push operations (such as tagging).
This example illustrates several fundamental principals of Docker:
- use Docker for executables, but keep data and build dirs in your host file system
- don't work in the context of the container, only use it to run commands (bitbake in this case)
- don't store state in the container -- keep that in your host file system
This container is based on Debian. Debian has proven to be an excellent OS for production OE builds where you might need to generate builds for a project over a period of years. OE can be rather fussy about versions of host packages (such as gcc, make, etc) so having a build distro where these are locked down is essential.
Processes in the container run as the "build" user by default. The above example shows how to map your user into this container. If you start the container manually, you may see something like the below:
I have no name!@364555e0516c:/home/cbrake2/yoe-distro$
I have no name can be ignored.
Cliff Brake firstname.lastname@example.org
improvements/pull requests welcome!