Add Dependencies and Tools to Existing Projects
In this article you will learn how to add external dependencies and tools to an existing single-container project created with Torizon IDE Extension 2 using one of our supported templates.
It includes instructions on how to use
torizonPackages.json and gives a general direction for those who want to manually add packages by directly changing
Why Add Dependencies and Tools to an IDE Extension 2 Project
Your application might need some external libraries and other utilities available in most Linux distro repositories or built by your team. TorizonCore uses containers to pack software resources needed for your application. Hence, the way for adding dependencies and tools to a project in Torizon is to add it to the containers. It provides isolation from your host machine, portability, reproducibility and ease of deployement of the application.
- Basic understanding of the Torizon IDE Extension 2.
- Toradex Computer on Module (CoM) with TorizonCore installed.
- Set up development environment for the IDE Extension 2.
- Created a Single-Container Project with the IDE Extension 2.
The instructions provided in this article work for both Linux and Windows environments.
Add Debian Packages with torizonPackages.json
Our project templates use containers based on Debian. These templates come with a file called
torizonPackages.json, where you can easily add packages available in the Debian feeds to debug and production container images.
The packages specified in this file will be automatically added to
Dockerfile.sdk files when building the project, according to the following rules:
- Packages in the
depsarray will be added to
Dockerfile(Release container image)
- Packages in the
devDepsarray will be added to
Dockerfile.debug(Debug container image) and
Dockerfile.sdk(SDK container image used in C/C++ projects)
1.Choose the Package: the IDE Extension 2 supports auto-completion of packages from the Debian feeds in the
To trigger it press
Ctrl + Space inside the array, wait for it to load, then start typing the package name:
- Check the Description: under the list of packages, it will also show the selected package description:
If the description doesn't appear, press
Ctrl + Space again, as this key combination is a VS Code shortcut that hides or shows a list item description.
- Add the package: add all the packages you need in a common .JSON list format.
Manually Add Debian Packages
Although it is recommended to use
torizonPackages.json as detailed above for a more convenient solution, you can also manually add packages by directly editing
Dockerfile.sdk. In each file, add the packages you need with an
apt-get install instruction, like the example below:
RUN apt-get -q -y update && \
apt-get -q -y install \
libasound2-dev:arm64 && \
apt-get clean && apt-get autoremove && rm -rf /var/lib/apt/lists/*
When manually adding packages to
Dockerfile.sdk always put the SoM architecture after each entry e.g.
libgpiod-dev:armhf, as otherwise it will default to the host machine architecture, usually
Changing the Debian Package Version
By default the auto-complete feature used in
torizonPackages.json will search packages from the
You can use other Debian feeds by changing the
apollox.debianRelease setting to one of the following values:
This change can be done globally or in a single project.
- Type to choose
Preferences: Open Settings (JSON)
- Add a line similar to the example below:
In a single project
- Go to
.vscode/settings.jsonfile, present in the project directory
- Add the
apollox.debianReleasesetting, configured to the desired Debian feed. This overwrites the global setting
Note that this only changes the feeds used in the auto-complete feature and not the Debian version used in the container images, which you can alter by manually editing the corresponding