KansaiRobot
KansaiRobot

Reputation: 10012

Yocto in containers

I am new to Yocto so apologies for any mistakes.

I understand roughly that Yocto can be used for Embedded linux. (I got one example of installing it and running it on a Rapsberry Pi). I also read about running a emulator in the host computer.

My question is, is there a way to run Yocto inside a (docker) container? So that I can run this container on my PC

Upvotes: 2

Views: 2194

Answers (2)

Gavin
Gavin

Reputation: 144

Kas is a very good project which match your requirement very well.

Kas is a setup tool for bitbake-based projects. It simplifies the process of managing and building Yocto Project-based systems. Here are some key features provided by the kas build tool:

  • Cloning and Checking Out Bitbake Layers:

kas can clone and checkout bitbake layers, making it easier to manage your project’s dependencies.

  • Creating Default Bitbake Settings:

It initializes default bitbake settings such as machine type, architecture, etc.

  • Launching a Minimal Build Environment:

kas starts a minimal build environment, reducing the risk of host contamination. This environment is isolated from the host system, ensuring a clean build process.

  • Initiating the Bitbake Build Process: Once set up, kas can initiate the bitbake build process for your embedded Linux system.

You can check the detail at: https://kas.readthedocs.io/en/latest/

You can install kas via pip or just clone it from github. It has a script kas-container to run the build inside container which already have all yocto dependent software installed.

Upvotes: -3

justinsg
justinsg

Reputation: 858

Yocto is a tool for building a custom Linux-based OS for your chosen hardware target (e.g. Raspberry Pi, x86-64 PC, etc.). It also fully supports various devices emulated by QEMU, which is helpful for development and testing.

It is quite straightforward to run your Yocto builds inside containers during development (e.g. using a ubuntu-20.04 container), and this helpfully keeps your development environment consistent.

However, if you would like to use Yocto to build a container that you can then run using Docker (rather than building for a specific board or emulator), then this is more complex and not supported out-of-the-box. Containers typically don't need a complete filesystem and kernel to run (this is Yocto's usual output), and so there is quite a lot of work required to trim it down and configure it to do this. There was a presentation at ELC 2018 about it (video, slides).

Perhaps take a look through the Overview and Concepts Manual, which explains a bit more information about the architecture, QEMU emulator, and development environment.

Upvotes: 3

Related Questions