- As a first step I build the Docker-Image direct on the target. → Success
- As a second step customize TorizonCore with the Builder to include above made Docker-Images. → Build failed
Now step 1 in detail:
Install unchanges Image “docker-apalis-imx8-Tezi_5.7.2+build.20.tar” on apalis-imx8.
Start apalis and open remote-terminal on it.
Build Image according Docker Guideline:
Quickstart: Compose and Django according following link:
(awesome-compose/README.md at master · docker/awesome-compose · GitHub)
Create an empty project directory.
Create a new file called Dockerfile in your project directory and add suggested text.
Create a requirements.txt in your project directory and add suggested text.
Create a file called docker-compose.yml in your project directory and add suggested text.
Create the Django project by running the docker compose run command as suggested.
→ The image is built with success.
Now step 2 in detail:
Open terminal on Ubuntu 18.04.
Install TorizonCore Builder according following link:
(TorizonCore Builder Tool - Customizing TorizonCore Images | Toradex Developer Center)
$ mkdir -p ~/tcbdir/ && cd ~/tcbdir/
$ wget https://raw.githubusercontent.com/toradex/tcb-env-setup/master/tcb-env-setup.sh
$ cd ~/tcbdir/
$ source tcb-env-setup.sh
$ torizoncore-builder build --create-template
add my project files (same as above):
/baseImage/docker-apalis-imx8-Tezi_5.7.2+build.20.tar
/myProject/docker-compose.yml
/myProject/requirements.txt
/myProject/Dockerfile
edit tcbuild.yaml:
input:
easy-installer:
local: baseImage/torizon-core-docker-apalis-imx8-Tezi_5.7.2+build.20.tar
output:
easy-installer:
local: hums-torizon-core-docker-Tezi_0.0.1.CUSTOM
bundle:
platform: linux/arm/v7
dir: bundle/
compose-file: myProject/docker-compose.yml
execute TorizonCore Builder with:
$ torizoncore-builder --verbose bundle myProject/docker-compose.yml
Build Output:
2023-04-17 08:33:18,490 - docker.utils.config - DEBUG - Trying paths: [‘/root/.docker/config.json’, ‘/root/.dockercfg’]
2023-04-17 08:33:18,490 - docker.utils.config - DEBUG - No config file found
2023-04-17 08:33:18,490 - docker.utils.config - DEBUG - Trying paths: [‘/root/.docker/config.json’, ‘/root/.dockercfg’]
2023-04-17 08:33:18,490 - docker.utils.config - DEBUG - No config file found
2023-04-17 08:33:18,494 - urllib3.connectionpool - DEBUG - http://localhost:None “GET /version HTTP/1.1” 200 786
2023-04-17 08:33:18,496 - urllib3.connectionpool - DEBUG - http://localhost:None “GET /v1.41/containers/json?limit=-1&all=0&size=0&trunc_cmd=0&filters=%7B%22name%22%3A+%5B%22tcb_1681720397%22%5D%7D HTTP/1.1” 200 1653
2023-04-17 08:33:18,497 - urllib3.connectionpool - DEBUG - http://localhost:None “GET /v1.41/containers/f4d0d7d4da0f395d6c8a03404a16a3cad05b2a2178ab7fddbb822a0a61b39706/json HTTP/1.1” 200 None
2023-04-17 08:33:18,498 - torizon.tcbuilder.backend.common - DEBUG - Current container ID (found by container name): f4d0d7d4da0f395d6c8a03404a16a3cad05b2a2178ab7fddbb822a0a61b39706
2023-04-17 08:33:18,499 - urllib3.connectionpool - DEBUG - http://localhost:None “GET /v1.41/containers/f4d0d7d4da0f395d6c8a03404a16a3cad05b2a2178ab7fddbb822a0a61b39706/json HTTP/1.1” 200 None
2023-04-17 08:33:18,499 - torizon.tcbuilder.cli.bundle - INFO - Creating Docker Container bundle…
2023-04-17 08:33:18,499 - compose.config.config - DEBUG - Using configuration files: /workdir/myProject/docker-compose.yml
2023-04-17 08:33:18,508 - root - ERROR - Error: Could not load the Docker compose file ‘myProject/docker-compose.yml’.
2023-04-17 08:33:18,509 - root - DEBUG - Traceback (most recent call last):
File “/builder/tcbuilder/backend/bundle.py”, line 535, in download_containers_by_compose_file
config = compose.config.load(details)
File “/usr/local/lib/python3.9/dist-packages/compose/config/config.py”, line 392, in load
processed_files = [
File “/usr/local/lib/python3.9/dist-packages/compose/config/config.py”, line 393, in
process_config_file(config_file, config_details.environment, interpolate=interpolate)
File “/usr/local/lib/python3.9/dist-packages/compose/config/config.py”, line 581, in process_config_file
validate_against_config_schema(config_file)
File “/usr/local/lib/python3.9/dist-packages/compose/config/validation.py”, line 449, in validate_against_config_schema
handle_errors(
File “/usr/local/lib/python3.9/dist-packages/compose/config/validation.py”, line 514, in handle_errors
raise ConfigurationError(
compose.config.errors.ConfigurationError: The Compose file ‘/workdir/myProject/docker-compose.yml’ is invalid because:
Unsupported config option for services: ‘db’
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File “/builder/torizoncore-builder”, line 221, in
mainargs.func(mainargs)
File “/builder/tcbuilder/cli/bundle.py”, line 97, in do_bundle
bundle(bundle_dir=args.bundle_directory,
File “/builder/tcbuilder/cli/bundle.py”, line 49, in bundle
bundle_be.download_containers_by_compose_file(
File “/builder/tcbuilder/backend/bundle.py”, line 538, in download_containers_by_compose_file
raise OperationFailureError(
tcbuilder.errors.OperationFailureError: Error: Could not load the Docker compose file ‘myProject/docker-compose.yml’.