torizon@verdin-imx8mp-15229850:~$ sudo tdx-info
Password:
Software summary
------------------------------------------------------------
Bootloader: U-Boot
Kernel version: 5.15.148-6.6.1+git.23a8e831749d #1-TorizonCore SMP PREEMPT Thu Feb 29 20:25:21 UTC 2024
Kernel command line: root=LABEL=otaroot rootfstype=ext4 quiet logo.nologo vt.global_cursor_default=0 plymouth.ignore-serial-consoles splash fbcon=map:3 ostree=/ostree/boot.1/torizon/f5f0b9e40c1595ab904ce493a792a0b54e17f0dc3ce6832ddb889452bdd13704/0
Distro name: NAME="TorizonCore"
Distro version: VERSION_ID=6.6.1-build.14
Distro variant: VARIANT="Docker"
Hostname: verdin-imx8mp-15229850
------------------------------------------------------------
Hardware info
------------------------------------------------------------
HW model: Toradex Verdin iMX8M Plus WB on Verdin Development Board
Toradex version: 0058 V1.1B
Serial number: 15229850
Processor arch: aarch64
------------------------------------------------------------
[Hardware Configuration]
Verdin iMX8M Plus Evaluation Kit with Touchscreen
with:
SOM i.MX8M Plus Quad 4GB WB IT v1.1B
Dahlia Carrier Board v1.1D
Verdin DSI to LVDS rev 1.1A
Capacitive Touch Display 10.1" v1.0A
I use the Torizon IDE extension version v2.5.1 and VS Code 1.90.1 on my Windows 11 Business 23H2.
VS Code
Version: 1.90.1 (user setup)
Commit: 611f9bfce64f25108829dd295f54a6894e87339d
Date: 2024-06-11T21:01:24.262Z
Electron: 29.4.0
ElectronBuildId: 9593362
Chromium: 122.0.6261.156
Node.js: 20.9.0
V8: 12.2.281.27-electron.0
OS: Windows_NT x64 10.0.22631
The Dockerfile of my CMake C++ project is as below:
I have just added the installation of procps package which contains ps and top utilities.
I am using it for interactive tests when I run my docker image on my target (Verdin ;.MX 8M Plus)
ARG CROSS_SDK_BASE_TAG=3.2.1-bookworm
ARG BASE_VERSION=3.2.1-bookworm
##
# Board architecture
# arm or arm64
##
ARG IMAGE_ARCH=
##
# Directory of the application inside container
##
ARG APP_ROOT=
# BUILD ------------------------------------------------------------------------
FROM torizon/debian-cross-toolchain-${IMAGE_ARCH}:${CROSS_SDK_BASE_TAG} As Build
ARG APP_ROOT
ARG IMAGE_ARCH
# __deps__
RUN apt-get -q -y update && \
apt-get -q -y install \
cmake \
procps \
# DO NOT REMOVE THIS LABEL: this is used for VS Code automation
# __torizon_packages_dev_start__
# __torizon_packages_dev_end__
# DO NOT REMOVE THIS LABEL: this is used for VS Code automation
&& \
apt-get clean && apt-get autoremove && \
rm -rf /var/lib/apt/lists/*
# __deps__
COPY . ${APP_ROOT}
WORKDIR ${APP_ROOT}
# Remove the code from the debug builds, inside this container, to build the
# release version from a clean build
RUN rm -rf ${APP_ROOT}/build-${IMAGE_ARCH}
RUN if [ "$IMAGE_ARCH" = "arm64" ] ; then \
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -Bbuild-${IMAGE_ARCH} ; \
elif [ "$IMAGE_ARCH" = "arm" ] ; then \
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=arm-linux-gnueabihf-g++ -DCMAKE_C_COMPILER=arm-linux-gnueabihf-gcc -Bbuild-${IMAGE_ARCH} ; \
fi
RUN cmake --build build-${IMAGE_ARCH}
# BUILD ------------------------------------------------------------------------
# DEPLOY -----------------------------------------------------------------------
FROM --platform=linux/${IMAGE_ARCH} torizon/debian:${BASE_VERSION} AS Deploy
ARG IMAGE_ARCH
ARG APP_ROOT
RUN apt-get -y update && apt-get install -y --no-install-recommends \
# DO NOT REMOVE THIS LABEL: this is used for VS Code automation
# __torizon_packages_prod_start__
# __torizon_packages_prod_end__
# DO NOT REMOVE THIS LABEL: this is used for VS Code automation
&& apt-get clean && apt-get autoremove && rm -rf /var/lib/apt/lists/*
# Copy the application compiled in the build step to the $APP_ROOT directory
# path inside the container, where $APP_ROOT is the torizon_app_root
# configuration defined in settings.json
COPY --from=Build ${APP_ROOT}/build-${IMAGE_ARCH}/bin ${APP_ROOT}
# "cd" (enter) into the APP_ROOT directory
WORKDIR ${APP_ROOT}
# Command executed in runtime when the container starts
CMD ["./skeleton-poolcop-app"]
# DEPLOY -----------------------------------------------------------------------
When I list my images on my WSL2 Ubuntu 22.04.4 LTS, I have the following list:
So, my image is not in the list which is normal since I have just removed it. (docker rmi .
Now, I clean my arm64 build and after I build the container release arm64 by doing so:
After, I list once again my docker images on my WSL2 Ubuntu 22.04:
I see in the list that there is an new image which appears, which has been created 17 hours ago.
The name of my application is skeleton-poolcop-app.
There is cross-toolchain-arm64-skeleton-poolcop-app in the list, but honestly I would like to know what this image is corresponding to, because in my mind of application programmer, clean-arm64 or the clean process, more generally, means usually the deletion of the files generated during the build process, like the object files (compilation of *.c and *.cpp into .o) and the result of the linkage (skeleton-poolcop-app).
There’s definitely something I’m confusing terminology with. But, let’s continue.
After, as I do not want to debug my application, but build it in release mode to make it the smallest one, as well as the image, I click on the task named “build-container-torizon-release-arm64”.
* Executing task: DOCKER_HOST= docker compose build --pull --build-arg SSHUSERNAME=torizon --build-arg APP_ROOT=/home/torizon/app --build-arg IMAGE_ARCH=arm64 --build-arg GPU=-vivante skeleton-poolcop-app
WARN[0000] The "LOCAL_REGISTRY" variable is not set. Defaulting to a blank string.
WARN[0000] /home/flepron/dev/skeleton-poolcop-app/docker-compose.yml: `version` is obsolete
[+] Building 1.0s (17/17) FINISHED docker:default
=> [skeleton-poolcop-app internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 2.56kB 0.0s
=> [skeleton-poolcop-app internal] load metadata for docker.io/torizon/debian:3.2.1-bookworm 0.8s
=> [skeleton-poolcop-app internal] load metadata for docker.io/torizon/debian-cross-toolchain-arm64:3.2.1-bookworm 0.8s
=> [skeleton-poolcop-app internal] load .dockerignore 0.0s
=> => transferring context: 56B 0.0s
=> [skeleton-poolcop-app build 1/7] FROM docker.io/torizon/debian-cross-toolchain-arm64:3.2.1-bookworm@sha256:e82fb5bd44dd76b65a2ce09e356036cac569384643e4535e3d546459377a8994 0.0s
=> [skeleton-poolcop-app internal] load build context 0.1s
=> => transferring context: 27.66kB 0.0s
=> [skeleton-poolcop-app deploy 1/4] FROM docker.io/torizon/debian:3.2.1-bookworm@sha256:c645d6bc14f7d419340df0be25dbbe115ada029fa2e502a1c9149f335c59fc08 0.0s
=> CACHED [skeleton-poolcop-app deploy 2/4] RUN apt-get -y update && apt-get install -y --no-install-recommends && apt-get clean && apt-get autoremove && rm -rf /var/lib/apt/lists/* 0.0s
=> CACHED [skeleton-poolcop-app build 2/7] RUN apt-get -q -y update && apt-get -q -y install cmake procps && apt-get clean && apt-get autoremove && rm -rf /var/lib/apt/lists/* 0.0s
=> CACHED [skeleton-poolcop-app build 3/7] COPY . /home/torizon/app 0.0s
=> CACHED [skeleton-poolcop-app build 4/7] WORKDIR /home/torizon/app 0.0s
=> CACHED [skeleton-poolcop-app build 5/7] RUN rm -rf /home/torizon/app/build-arm64 0.0s
=> CACHED [skeleton-poolcop-app build 6/7] RUN if [ "arm64" = "arm64" ] ; then cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -Bbuild-a 0.0s
=> CACHED [skeleton-poolcop-app build 7/7] RUN cmake --build build-arm64 0.0s
=> CACHED [skeleton-poolcop-app deploy 3/4] COPY --from=Build /home/torizon/app/build-arm64/bin /home/torizon/app 0.0s
=> CACHED [skeleton-poolcop-app deploy 4/4] WORKDIR /home/torizon/app 0.0s
=> [skeleton-poolcop-app] exporting to image 0.0s
=> => exporting layers 0.0s
=> => writing image sha256:7df66a04638341d8444ca33f3c028dacec400cddc65409ac0a4f5b7a8ce0ae59 0.0s
=> => naming to localhost:5002/skeleton-poolcop-app:arm64 0.0s
* Terminal will be reused by tasks, press any key to close it.
Now, I list my images on my WSL2 Ubuntu 22.04:
flepron@LAPTOPFRANCOIS:~$ docker image ls -a
REPOSITORY TAG IMAGE ID CREATED SIZE
cross-toolchain-arm64-skeleton-poolcop-app latest e5492c62ed68 19 hours ago 740MB
localhost:5002/skeleton-poolcop-app arm64 7df66a046383 20 hours ago 115MB
localhost:5002/test-cmake-debug arm64 51ddc351a08b 2 weeks ago 228MB
localhost:5002/uart-csharp-debug arm64 cd9b65047cd7 2 weeks ago 470MB
localhost:5002/test-console-csharp-8-debug arm64 b66c30062fcc 2 weeks ago 470MB
alpine latest 1d34ffeaf190 4 weeks ago 7.79MB
registry 2 d6b2c32a0f14 8 months ago 25.4MB
hello-world latest d2c94e258dcb 13 months ago 13.3kB
torizon/binfmt latest 893244d86992 3 years ago 37.5MB
flepron@LAPTOPFRANCOIS:~$
So, I see another image which has been created 20 hours ago with the name of the of my application. I do not understand why this image has not the timestamp of now, because I’ve just built the image.
Now, I run the pull the container in release mode using the task pull-container-torizon-release-arm64.
Here is the logs of this command:
* Executing task: DOCKER_HOST= docker compose build --pull --build-arg SSHUSERNAME=torizon --build-arg APP_ROOT=/home/torizon/app --build-arg IMAGE_ARCH=arm64 --build-arg GPU=-vivante skeleton-poolcop-app
WARN[0000] The "LOCAL_REGISTRY" variable is not set. Defaulting to a blank string.
WARN[0000] /home/flepron/dev/skeleton-poolcop-app/docker-compose.yml: `version` is obsolete
[+] Building 0.9s (17/17) FINISHED docker:default
=> [skeleton-poolcop-app internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 2.56kB 0.0s
=> [skeleton-poolcop-app internal] load metadata for docker.io/torizon/debian:3.2.1-bookworm 0.7s
=> [skeleton-poolcop-app internal] load metadata for docker.io/torizon/debian-cross-toolchain-arm64:3.2.1-bookworm 0.7s
=> [skeleton-poolcop-app internal] load .dockerignore 0.0s
=> => transferring context: 56B 0.0s
=> [skeleton-poolcop-app build 1/7] FROM docker.io/torizon/debian-cross-toolchain-arm64:3.2.1-bookworm@sha256:e82fb5bd44dd76b65a2ce09e356036cac569384643e4535e3d546459377a8994 0.0s
=> [skeleton-poolcop-app internal] load build context 0.0s
=> => transferring context: 27.66kB 0.0s
=> [skeleton-poolcop-app deploy 1/4] FROM docker.io/torizon/debian:3.2.1-bookworm@sha256:c645d6bc14f7d419340df0be25dbbe115ada029fa2e502a1c9149f335c59fc08 0.0s
=> CACHED [skeleton-poolcop-app deploy 2/4] RUN apt-get -y update && apt-get install -y --no-install-recommends && apt-get clean && apt-get autoremove && rm -rf /var/lib/apt/lists/* 0.0s
=> CACHED [skeleton-poolcop-app build 2/7] RUN apt-get -q -y update && apt-get -q -y install cmake procps && apt-get clean && apt-get autoremove && rm -rf /var/lib/apt/lists/* 0.0s
=> CACHED [skeleton-poolcop-app build 3/7] COPY . /home/torizon/app 0.0s
=> CACHED [skeleton-poolcop-app build 4/7] WORKDIR /home/torizon/app 0.0s
=> CACHED [skeleton-poolcop-app build 5/7] RUN rm -rf /home/torizon/app/build-arm64 0.0s
=> CACHED [skeleton-poolcop-app build 6/7] RUN if [ "arm64" = "arm64" ] ; then cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -Bbuild-a 0.0s
=> CACHED [skeleton-poolcop-app build 7/7] RUN cmake --build build-arm64 0.0s
=> CACHED [skeleton-poolcop-app deploy 3/4] COPY --from=Build /home/torizon/app/build-arm64/bin /home/torizon/app 0.0s
=> CACHED [skeleton-poolcop-app deploy 4/4] WORKDIR /home/torizon/app 0.0s
=> [skeleton-poolcop-app] exporting to image 0.0s
=> => exporting layers 0.0s
=> => writing image sha256:7df66a04638341d8444ca33f3c028dacec400cddc65409ac0a4f5b7a8ce0ae59 0.0s
=> => naming to localhost:5002/skeleton-poolcop-app:arm64 0.0s
* Terminal will be reused by tasks, press any key to close it.
* Executing task: DOCKER_HOST= docker compose push skeleton-poolcop-app
WARN[0000] The "LOCAL_REGISTRY" variable is not set. Defaulting to a blank string.
WARN[0000] /home/flepron/dev/skeleton-poolcop-app/docker-compose.yml: `version` is obsolete
[+] Pushing 13/0
âś” Pushing localhost:5002/skeleton-poolcop-app:arm64: 5f70bf18a086 Layer already exists 0.0s
âś” Pushing localhost:5002/skeleton-poolcop-app:arm64: 3743c7b2d27f Layer already exists 0.0s
âś” Pushing localhost:5002/skeleton-poolcop-app:arm64: 1b62cf9ee932 Layer already exists 0.0s
âś” Pushing localhost:5002/skeleton-poolcop-app:arm64: 4d43de620b2b Layer already exists 0.0s
âś” Pushing localhost:5002/skeleton-poolcop-app:arm64: 2b1b9a443581 Layer already exists 0.0s
âś” Pushing localhost:5002/skeleton-poolcop-app:arm64: 78b4e0bbebbf Layer already exists 0.0s
âś” Pushing localhost:5002/skeleton-poolcop-app:arm64: af2e04463901 Layer already exists 0.0s
âś” Pushing localhost:5002/skeleton-poolcop-app:arm64: fa80bad6bfa4 Layer already exists 0.0s
âś” Pushing localhost:5002/skeleton-poolcop-app:arm64: 99556bba1730 Layer already exists 0.0s
âś” Pushing localhost:5002/skeleton-poolcop-app:arm64: 5eda8e9db600 Layer already exists 0.0s
âś” Pushing localhost:5002/skeleton-poolcop-app:arm64: 9c76f5bd7f07 Layer already exists 0.0s
âś” Pushing localhost:5002/skeleton-poolcop-app:arm64: 39940505a96f Layer already exists 0.0s
âś” Pushing localhost:5002/skeleton-poolcop-app:arm64: f4e4d9391e13 Layer already exists 0.0s
* Terminal will be reused by tasks, press any key to close it.
* Executing task: sshpass -p 959798 ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no torizon@192.168.10.111 DOCKER_LOGIN=192.168.10.112:5002 TAG=arm64 docker compose pull skeleton-poolcop-app
Warning: Permanently added '192.168.10.111' (ED25519) to the list of known hosts.
time="2024-06-20T09:04:08Z" level=warning msg="The \"LOCAL_REGISTRY\" variable is not set. Defaulting to a blank string."
skeleton-poolcop-app Pulling
2c6d21737d83 Already exists
fe3d200cde9c Already exists
721dc014b602 Already exists
b166b458b8a6 Already exists
6a1af1b6d795 Already exists
f17170ca9bf6 Already exists
3be06dfecdc9 Already exists
ca0693d0a393 Already exists
9c4d219b5f5f Already exists
4ea4fdc87dfe Already exists
48836db3eabb Pulling fs layer
ff2d95f9120e Pulling fs layer
4f4fb700ef54 Pulling fs layer
48836db3eabb Downloading [==================================================>] 366B/366B
48836db3eabb Verifying Checksum
48836db3eabb Download complete
4f4fb700ef54 Downloading [==================================================>] 32B/32B
ff2d95f9120e Downloading [=========> ] 3.646kB/19.84kB
4f4fb700ef54 Verifying Checksum
4f4fb700ef54 Download complete
ff2d95f9120e Downloading [==================================================>] 19.84kB/19.84kB
48836db3eabb Extracting [==================================================>] 366B/366B
ff2d95f9120e Verifying Checksum
ff2d95f9120e Download complete
48836db3eabb Extracting [==================================================>] 366B/366B
48836db3eabb Pull complete
ff2d95f9120e Extracting [==================================================>] 19.84kB/19.84kB
ff2d95f9120e Extracting [==================================================>] 19.84kB/19.84kB
ff2d95f9120e Pull complete
4f4fb700ef54 Extracting [==================================================>] 32B/32B
4f4fb700ef54 Extracting [==================================================>] 32B/32B
4f4fb700ef54 Pull complete
skeleton-poolcop-app Pulled
* Terminal will be reused by tasks, press any key to close it.
Now, I list my docker images on my target device (SOM Verdin i.MX 8M Plus).
torizon@verdin-imx8mp-15229850:~$ docker image ls -a
REPOSITORY TAG IMAGE ID CREATED SIZE
192.168.10.112:5002/skeleton-poolcop-app arm64 7df66a046383 21 hours ago 115MB
192.168.10.112:5002/test-cmake-debug arm64 51ddc351a08b 2 weeks ago 228MB
192.168.10.112:5002/uart-csharp-debug arm64 cd9b65047cd7 2 weeks ago 470MB
192.168.10.112:5002/test-console-csharp-8-debug arm64 b66c30062fcc 2 weeks ago 470MB
nodered/node-red 3.1.3 12234ad916b0 5 months ago 564MB
torizon@verdin-imx8mp-15229850:~$
The date is always confusing : 21 hours ago for 192.168.10.112:5002/skeleton-poolcop-app !
I notice that my 192.168.10.112, is the IPv4 address of my Windows 11 Pro machine where my WSL2 Ubuntu 22.04 is installed. I do not know why because docker is installed on Ubuntu and not on my Windows machine.
After, I run interactively my docker image executing /bin/bash
torizon@verdin-imx8mp-15229850:~$ docker run -it --entrypoint /bin/bash 7df66a046383
root@373fa9ca2241:/home/torizon/app# ls -al
total 92
drwxr-xr-x 2 root root 4096 Jun 19 12:15 .
drwxr-xr-x 1 torizon torizon 4096 Jun 19 12:15 ..
-rwxr-xr-x 1 root root 83320 Jun 19 12:15 skeleton-poolcop-app
root@373fa9ca2241:/home/torizon/app# ps
bash: ps: command not found
root@373fa9ca2241:/home/torizon/app# top
bash: top: command not found
root@373fa9ca2241:/home/torizon/app# apt-get update
Get:1 http://deb.debian.org/debian bookworm InRelease [151 kB]
Get:2 http://deb.debian.org/debian bookworm-updates InRelease [55.4 kB]
Get:3 http://deb.debian.org/debian-security bookworm-security InRelease [48.0 kB]
Get:4 https://feeds.toradex.com/debian/snapshots/20231122T181708Z testing InRelease [15.1 kB]
Get:5 http://deb.debian.org/debian bookworm/main arm64 Packages [8685 kB]
Get:6 http://deb.debian.org/debian bookworm-updates/main arm64 Packages [13.7 kB]
Get:7 http://deb.debian.org/debian-security bookworm-security/main arm64 Packages [157 kB]
Get:8 https://feeds.toradex.com/debian/snapshots/20231122T181708Z testing/main arm64 Packages [59.7 kB]
Get:9 https://feeds.toradex.com/debian/snapshots/20231122T181708Z testing/non-free arm64 Packages [5271 B]
Fetched 9190 kB in 3s (2762 kB/s)
Reading package lists... Done
N: Repository 'Debian bookworm' changed its 'non-free component' value from 'non-free' to 'non-free non-free-firmware'
N: More information about this can be found online in the Release notes at: https://www.debian.org/releases/bookworm/arm64/release-notes/ch-information.html#non-free-split
root@373fa9ca2241:/home/torizon/app# apt-get install procps
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
libncursesw6 libproc2-0
Recommended packages:
libgpm2 psmisc
The following NEW packages will be installed:
libncursesw6 libproc2-0 procps
0 upgraded, 3 newly installed, 0 to remove and 18 not upgraded.
Need to get 880 kB of archives.
After this operation, 3591 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian bookworm/main arm64 libncursesw6 arm64 6.4-4 [122 kB]
Get:2 http://deb.debian.org/debian bookworm/main arm64 libproc2-0 arm64 2:4.0.2-3 [60.1 kB]
Get:3 http://deb.debian.org/debian bookworm/main arm64 procps arm64 2:4.0.2-3 [698 kB]
Fetched 880 kB in 0s (6886 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package libncursesw6:arm64.
(Reading database ... 6895 files and directories currently installed.)
Preparing to unpack .../libncursesw6_6.4-4_arm64.deb ...
Unpacking libncursesw6:arm64 (6.4-4) ...
Selecting previously unselected package libproc2-0:arm64.
Preparing to unpack .../libproc2-0_2%3a4.0.2-3_arm64.deb ...
Unpacking libproc2-0:arm64 (2:4.0.2-3) ...
Selecting previously unselected package procps.
Preparing to unpack .../procps_2%3a4.0.2-3_arm64.deb ...
Unpacking procps (2:4.0.2-3) ...
Setting up libproc2-0:arm64 (2:4.0.2-3) ...
Setting up libncursesw6:arm64 (6.4-4) ...
Setting up procps (2:4.0.2-3) ...
Processing triggers for libc-bin (2.36-9+deb12u3) ...
root@373fa9ca2241:/home/torizon/app# ps
PID TTY TIME CMD
1 pts/0 00:00:00 bash
213 pts/0 00:00:00 ps
root@373fa9ca2241:/home/torizon/app#
The thing I see, is that the package procps has not been installed at all in my docker image as specified in my Dockerfile.
# __deps__
RUN apt-get -q -y update && \
apt-get -q -y install \
cmake \
procps \
# DO NOT REMOVE THIS LABEL: this is used for VS Code automation
# __torizon_packages_dev_start__
# __torizon_packages_dev_end__
# DO NOT REMOVE THIS LABEL: this is used for VS Code automation
&& \
apt-get clean && apt-get autoremove && \
rm -rf /var/lib/apt/lists/*
# __deps__
Could you please help me on this ?
Maybe, I do not follow the good steps to produce a release version containing needed packages.
Thank you for your assistance.
Sincerely,
François.