Search by Tags

Qt Debian Container for Torizon

 
Applicable for

Article updated at 28 May 2019
Subscribe for this article updates

Introduction

Toradex developed a Qt container and uploaded in the docker hub. Following are the advantages of the Qt container:

  • You can keep applications independent
  • Use different runtimes
  • Encapsulate application dependencies in the container
  • It will be easier to maintain

This article complies to the Typographic Conventions for Torizon Documentation.

Prerequisites

To have a better understanding of this article the following prerequisites are proposed:

  • Computer on Module with Torizon installed
  • (optional) Basic understanding of Docker and docker run command options

Run a Weston Container

Open two Debian shells of the module on your development machine. Run on both shell instances:

$ ssh torizon@”ip address” 

Now you are connected to the board via SSH on both shells. In the first shell, start a Weston container which will be the the graphics server:

# docker run --rm -it --privileged -v /tmp:/tmp -v /dev:/dev torizon/arm32v7-debian-weston:buster weston-launch --tty=/dev/tty7 --user=root

Note: Since the weston image has not been downloaded yet, the run command will start pulling the weston image automatically with the following message: Unable to find image 'torizon/arm32v7-debian-weston:buster locally

Run a Qt Wayland Container

Run the command below on the 2nd instance of the shell to start a Qt Wayland container. It has Qt libraries and it works on top of Wayland:

# docker run --rm -it -v /tmp:/tmp torizon/arm32v7-debian-qt5-wayland:buster

Alternatively run the command below on the 2nd instance of the shell to start a Qt wayland container with hardware access permission. Since it has hardware access, performance will be better than the previous (non-privileged) qt5-wayland container. We are sharing the full /dev directory here. If you want, you can do a more granular access as well by bind-mounting only the subdirectories of /dev:

docker run --rm -it --privileged -v /dev:/dev -v /tmp:/tmp torizon/arm32v7-debian-qt5-wayland:buster

Start a Qt Sample Application

Inside the Qt Wayland container shell run any one of the following applications to confirm that the Qt Wayland container is running successfully on the 2nd instance of the shell:

## /usr/lib/arm-linux-gnueabihf/qt5/examples/widgets/widgets/calculator/calculator &

or

## /usr/lib/arm-linux-gnueabihf/qt5/examples/widgets/widgets/shapedclock/shapedclock &

or

## /usr/lib/arm-linux-gnueabihf/qt5/examples/opengl/cube/cube &

Also, please watch this video session for more information.