Two qt application containerization using docker

I have yocto custom image called tdx-reference-multimedia-qt6-image and inside that I have meta-qt6-application layer. Inside that image I have 2 qt qml 6 source files called cluster and automotive.I want to make 2 containers on the top the image tdx-reference-multimedia-image.One container should contain automotive application and it should display on hdmi .The other container should contain the application called cluster and it should dispaly on lvds screen.

Hi, I’m the Toradex AI Assistant. I’m in early beta, and I would appreciate your feedback.
The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Hello,

Containerizing two Qt applications using Docker on a Toradex device with a custom Yocto image involves several steps. Here’s a general approach to achieve this on Torizon, which is well-suited for containerized applications:

  1. Prepare the Base Docker Images: Ensure you have Docker images based on Torizon that include the necessary dependencies for Qt applications. You might need to create custom Docker images that include Qt6 and any other dependencies your applications require.

  2. Dockerfile for Each Application:

    • Automotive Application: Create a Dockerfile for the automotive application. This Dockerfile should use the base image prepared in step 1 and copy the automotive application binaries and resources into the container. Set up the environment to run the Qt application, ensuring it’s configured to display on the HDMI screen.
    • Cluster Application: Similarly, create a Dockerfile for the cluster application, ensuring it’s set up to display on the LVDS screen. This might involve configuring the environment or display settings specifically for LVDS output.
  3. Running Containers with Display Configuration:

    • To direct the output of each application to the correct display (HDMI or LVDS), you will need to use the appropriate environment variables or configuration files. For Qt applications, this often involves setting the QT_QPA_PLATFORM variable to specify the backend (e.g., eglfs for fullscreen EGL support) and possibly other variables for device-specific configurations.
    • For HDMI display, you might set QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT to match the HDMI display’s dimensions and QT_QPA_PLATFORM to eglfs or another appropriate backend.
    • For the LVDS display, the setup might involve similar environment variables, tailored to the LVDS screen’s specifications. Additionally, if your hardware supports it, you might need to configure the framebuffer or use a specific device overlay to enable and configure the LVDS output.
  4. Docker Compose:

    • Consider using a docker-compose.yml file to manage both containers. This allows you to define both applications and their configurations in a single file, making it easier to start, stop, and manage the applications together.
    • In the docker-compose.yml, specify the Dockerfiles, environment variables, and any volume mounts or network settings required for each application.
  5. Testing and Deployment:

    • After setting up the Dockerfiles and `docker-compose

Please, also check if these links can help you solve your problem:

Custom meta layers, recipes and images in Yocto Project (hello-world examples) | Toradex Developer Center.

Hi @Shanmugapriyan ,
You can not run container on reference images as it does not have docker runtime.
You might like to read about reference images and Torizon