Using TorizonCore Builder to pre-provision docker containers

Hello,

I’m trying to use TorizonCore builder to pre-provision containers to a TEZI-installable image. I’ve installed TorizonCore Builder using the shell script, and am now following this guide to try to create a TorizonCore image with a hello-world Docker container preprovisioned.

When I follow the steps in the guide, the tar that is generated is identical to the vanilla TorizonCore image I’m basing it on - it does not contain the preprovisioned container.

Am I misunderstanding how this tool is supposed to work? I’d eventually like to create a TEZI-compatible image that contains all of my applications in containers, running on vanilla Torizon.

For clarity, console output of what I am attempting is shown below:

user@ubuntu:~/tcb-test$ cat docker-compose.yml
version: '2.4'

services:
  hello-world:
    image: hello-world
user@ubuntu:~/tcb-test$
user@ubuntu:~/tcb-test$ mkdir image && wget -P image/ https://artifacts.toradex.com/artifactory/torizoncore-oe-prerelease-frankfurt/dunfell-5.x.y/monthly/12/apalis-imx6/torizon-upstream/torizon-core-docker/oedeploy/torizon-core-docker-apalis-imx6-Tezi_5.3.0-devel-202105+build.12.tar
2021-05-21 12:47:51 (9.77 MB/s) - ‘image/torizon-core-docker-apalis-imx6-Tezi_5.3.0-devel-202105+build.12.tar’ saved [173742080/173742080]

user@ubuntu:~/tcb-test$ torizoncore-builder bundle --host-workdir=$(pwd) --platform=linux/arm/v7 --file docker-compose.yml
user@ubuntu:~/tcb-test$ torizoncore-builder combine --image-directory ./image --output-directory ./image_output
Creating copy of TorizonCore source image.
Combining TorizonCore image with Docker Container bundle.
Successfully created a TorizonCore image with Docker Containers preprovisioned in ./image_output
user@ubuntu:~/tcb-test$ # The generated archive is the same as the source archive:
user@ubuntu:~/tcb-test$ sha256sum image/torizon* image_output/torizon*
ac02982caba038e9be93b09cbf4b147a9ea0faf0f170d86e1ff7aea5e3dd23e5  image/torizon-core-docker-apalis-imx6-Tezi_5.3.0-devel-202105+build.12.tar
ac02982caba038e9be93b09cbf4b147a9ea0faf0f170d86e1ff7aea5e3dd23e5  image_output/torizon-core-docker-apalis-imx6-Tezi_5.3.0-devel-202105+build.12.tar

Greetings @tyler_,

The main issue here is the usage of the combine command. It’s a little unclear but for --image-directory you need to pass it the Easy Installer folder itself untarred.

Meaning the command should look like this:

torizoncore-builder combine --image-directory ./image/torizon-core-docker-apalis-imx6-Tezi_5.3.0-devel-202105+build.12 --output-directory ./image_output

It’s actually surprising the combine command didn’t throw an error for you. This is something I’ll report so we can improve on it.

Best Regards,
Jeremias

Hi @jeremias.tx ,
Thanks for the quick response. That was indeed my issue - I just tried again using an unpacked source image, and after installation I see the hello-world docker container on the board.

I agree that the current command output is confusing.

Tyler

Glad I could help!