Sample: containerized applications¶
This sample shows how to customize Welma to run some containerized applications at start-up. It can be used to experiment with Welma and as a starting point for your own application and distribution.
This demo setup includes two container runtimes (Runc and Systemd-nspawn) to support different containerized applications (demo-headless and the nginx demo). While having multiple container runtimes installed on the same system is not a typical production configuration, it is used here to illustrate Welma's flexibility and to simplify experimentation with both runtimes.
Running the demo¶
Configure the build¶
You can use the templates provided to easily set up the build environment.
source meta-welma/setup/setup-build-env \
meta-welma-*/conf/templates/$MACHINE \
meta-demo-headless/conf/templates/demo-container
The images are now available and ready to be built:
Build and run¶
Build the target image:
After deploying it on your device or emulator and logging on the system, you will be able to see the applications running and logging cpu usage periodically:
May 20 09:33:42 sm2s-imx8plus-mbep5 runc-demo-headless-app[564]: demo-headless-app:cpu-info:cpu 505 1 1549 8760 111 46 20 0 0 0
May 20 09:33:42 sm2s-imx8plus-mbep5 nspawn-demo-headless-app[518]: demo-headless-app:cpu-info:cpu 505 1 1549 8902 111 47 20 0 0 0
May 20 09:33:43 sm2s-imx8plus-mbep5 runc-demo-headless-app[564]: demo-headless-app:cpu-info:cpu 505 1 1549 9157 111 47 20 0 0 0
May 20 09:33:43 sm2s-imx8plus-mbep5 nspawn-demo-headless-app[518]: demo-headless-app:cpu-info:cpu 505 1 1550 9299 111 47 20 0 0 0
You can also access the nginx demos from a browser using the machine IP and the according ports:
Systemd-nspawn on port 80 | Runc on port 81 |
---|---|
![]() |
![]() |
That's it ! You can now experiment with your own containerized application,
dive into the implementation below, or look at the Next steps.
Container runtime¶
To manage containers, the demos are using Runc and systemd-nspawn as their container runtimes. Those are low level CLI tools for spawning and running containers on Linux. The containers are created and configured for each runtime from the Yocto recipes.
Theses demonstrations can be used as a starting point to run containerized applications that uses other runtime.
Next steps¶
You can continue by:
- Configuring your distribution for Application development
- Diving into the Continuous Integration or how Software updates work