Confused about dockers and Linux environment

Hi,
I’m trying to understand the docker concept. I did look at some videos and I’ m following the Quick Start guide.

I’m confused about the following:

Does TorizonCore run some Linux version? And are the dockers running inside this Linux environment?

If so, then why is there a Ubuntu and Debian docker available. Why would we need to run a Ubuntu docker when there is already some Linux running?

If not, then what am I connected to when connecting with SSH to the board? It seems some Linux environment to me.

Maybe these are stupid questions, but for me this stuff is rather new.

Hello,

Does TorizonCore run some Linux version? And are the dockers running inside this Linux environment?

TorizonCore is a Linux distribution. We build it with the Yocto Project from source (and we have documentation so you can do it as well Build Torizon OS from Source With Yocto Project/OpenEmbedded | Toradex Developer Center). The containers do run inside of this custom Linux Distribution, yes.

If so, then why is there a Ubuntu and Debian docker available. Why would we need to run a Ubuntu docker when there is already some Linux running?

I think you are referring to the Debian containers we provide on top of TorizonCore. Using isolated environments such as containers makes it really easy for you to develop software in. The alternative is learning Yocto, but it has a very steep learning curve. Containers are widely available from reputable sources in the web, so running a webserver, GUI or whatever other program is trivial compared to the alternative (writing a recipe with Yocto, rebuilding the whole image or maybe using an SDK… which is significantly harder than using docker-compose or a docker run statement).

You also gain a lot of quality by adopting CI/CD practices, which is easier with containers. It’s easier to find programmers, because they don’t need to have domain-specific knowledge of embedded systems etc…

If not, then what am I connected to when connecting with SSH to the board? It seems some Linux environment to me.

Here I just used Tezi to install Torizon, which is just a very lean Linux distribution that can run containers and connect to our Torizon Platform. After ssh’ing into it, it drops me into the TorizonCore shell:

torizon@verdin-imx8mp-06817296:~$ echo "Hello from TorizonCore :)"
Hello from TorizonCore :)
torizon@verdin-imx8mp-06817296:~$ cat /etc/os-release 
ID=torizon
NAME="TorizonCore"
VERSION="6.3.0-devel-20230723233903+build.0 (kirkstone)"
VERSION_ID=6.3.0-devel-20230723233903-build.0
PRETTY_NAME="TorizonCore 6.3.0-devel-20230723233903+build.0 (kirkstone)"
DISTRO_CODENAME="kirkstone"
BUILD_ID="0"
ANSI_COLOR="1;34"
VARIANT="Docker"

I can then run one of our Debian containers and be dropped in a very familar working environment, with everything you expect from Debian, although the Kernel is tailored for the board and we provide custom packages to enable hardware-acceleration.

torizon@verdin-imx8mp-06817296:~$ docker run -it torizon/debian:3-bookworm bash
root@8f236f620f27:/# echo "Hello from a Debian container running on top of TorizonCore :)"
Hello from a Debian container running on top of TorizonCore :)
root@8f236f620f27:/# cat /etc/os-release 
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
root@8f236f620f27:/# 

Which, again, is significantly easier and faster than creating a custom distro like TorizonCore, which is maintained by embedded Linux specialists, so you can focus on creating value with applications instead of the underlying infrastructure.

Hope that cleared things up. We have a whole page with dedicated documentation regarding this very specific question, feel free to take a look as well: Torizon OS Technical Overview | Toradex Developer Center

1 Like

That is exactly what I want to do. But I’m trying to get things working for weeks now! And that is very frustrating.

And sorry, but your answer doesn’t clear up things for me. I just start to understand stuff and now there is something like Tezi. Please do not make it more complex.

I just want to run Ubuntu and some tools I know, so that I can start developing.

I just want to run Ubuntu and some tools I know, so that I can start developing.

I suggest you try one of the examples out, for example, Torizon Sample: Using OpenCV for Computer Vision | Toradex Developer Center :slight_smile: It will give you a good solid understanding of how things work within Torizon. Although we use Debian for our “reference” containers, it’s extremely similar to Ubuntu (Ubuntu is based on Debian), so you can use apt and all the tooling you’re accustomed to (https://github.com/toradex/torizon-samples/blob/bookworm/opencv/Dockerfile#L12).

The workflow will always be, like the example I linked above, something as follows:

Write the Dockerfile → Build and push to DockerHub → Run it from your board

That example also assumes you are cross compiling on a host, right? And using docker on the PC (host) to handle this.

I did not get docker working on the (WSL based) Ubuntu on the host. And I really do not want to go that route anymore. Way to complex for what we need to accomplish.

Also I need to develop OpenCV code in C++ and also want to show OpenCV output in some window.

Debian is probably fine too. I assume I can run a Debian version inside a container. That raises two questions:

1
Which version would I need to be able to show OpenCV output?

2
How can I make Debian persistent? Containers are removed when the system is shut down, right?
So how to create a Debian environment where I can do some development and continue with it the next day?

That example also assumes you are cross compiling on a host, right? And using docker on the PC (host) to handle this.

It’s actually natively compiling using QEMU user mode emulation. See Configure Build Environment for Torizon Containers | Toradex Developer Center. But it’s completely transparent to the end user, so you don’t really have to think about setting up a cross-compiler or an SDK. Just installing Docker according to the previous link will do fine.

Which version would I need to be able to show OpenCV output?

Refer to the branch name and the Dockerfile I linked you directly: https://github.com/toradex/torizon-samples/blob/bookworm/opencv/Dockerfile#L3. You can use either Bullseye containers with TorizonCore 5.x.y, which have a :2 tag or Bookworm containers with TorizonCore 6.x.y, which have a :3 tag. These are Debian versions, if you’re not familiar, like Ubuntu has Focal etc…

We have working OpenCV examples for both options, just switch the branch in the repo I linked before. I recommend you start with the latest TorizonCore 6 quarterly release.

How can I make Debian persistent? Containers are removed when the system is shut down, right?
So how to create a Debian environment where I can do some development and continue with it the next day?

You don’t actually develop within the target board, but on the host. You just need to rebuild the container and deploy (push and pull, as I previously mentioned). You can also setup for the application to auto-start when booting the board.

I very strongly suggest to run some examples to “get a feel for it”. I hope you’ll find it much easier than traditional embedded development, if you’re coming from that background :smile: