2

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

2 Answers 2

3

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.

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks!. >t is quite straightforward to run your Yocto builds inside containers during development (e.g. using a ubuntu-20.04 container), > By this you mean having a ubuntu container as a "Host" where to build the yocto images?
>chosen hardware target (e.g. Raspberry Pi, x86-64 PC, > I understand the Rpi case, but what do you mean x86-64 PC? Does that mean I can build a linux-based OS for the PC and run it there? Inside a container? a bit of detail here will be appreciated
Yes, in the ubuntu-20.04 example, it would be the host PC. You are correct about x86-64 target - Yocto could build an OS that you could boot on it. It would not run in a container, although you could include the docker package if you wanted to use Docker within that OS.
-3

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.

1 Comment

any affiliation? /help/promotion also, please show how to use it to solve the problem in the question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.