Relative path to docker-compose in tcbuild.yml

I am trying to use the same docker-compose.yml file that I created in my “Single Container Torizon Project” to define the containers to bundle in torizoncore-builder.

In my tcbuild.yml file, I have this line:

output:
  # Output section items (required).
  # ⚠️ change it for your needs
  easy-installer:
    local: chipotle-TCB-CUSTOM
    autoinstall: true
    accept-licence: true
    bundle:
      compose-file: ../repos/chipotle_dbpt/docker-compose.yml
      platform: linux/arm/v7 

It gives this error:

tcbuilder.errors.InvalidArgumentError: Error: File does not exist: ../repos/chipotle_dbpt/docker-compose.yml. Aborting.

I promise this file exists. If I open a terminal in VSCode, I can use that path to open that file.

If I can’t use relative paths in tcbuilder, how do I use the docker-compose.yml file that I already defined for my project? Am I supposed to make a different docker-compose for the purposes of the tcbuilder???

Hi, I’m the Toradex AI Assistant.

I might make mistakes. Our support team will step in if needed. If I answered your question, please tick the “Solution” checkbox. For follow-up questions to me, please use @ToradexAI in your post.

Did you like my answer? :+1: :-1:


Hello! Thank you for your question.

The issue you’re experiencing is due to how TorizonCore Builder restricts file paths. When specifying paths in your tcbuild.yml, all file and directory paths must be relative to the TorizonCore Builder working directory—this is usually the directory where you sourced the tcb-env-setup.sh script or where you launched the builder shell.

To fix this, you have two simple options:

  1. Copy your existing docker-compose.yml into your TorizonCore Builder working directory:
    Place the file directly in your working directory and update your tcbuild.yml like this:

    bundle:
      compose-file: docker-compose.yml
      platform: linux/arm/v7
    
  2. Change your working directory to match your current project structure:
    Navigate to a directory where the relative path (../repos/chipotle_dbpt/docker-compose.yml) makes sense with respect to the current working directory.
    For example, if you’re currently inside /home/user/torizoncore-builder and your file is at /home/user/repos/chipotle_dbpt/docker-compose.yml, then using the path as ../repos/chipotle_dbpt/docker-compose.yml is correct—as long as you start TorizonCore Builder in /home/user/torizoncore-builder.

Remember:

  • Absolute paths are not supported.
  • Relative paths must be accessible from the working directory when TorizonCore Builder is running.

You do not need to create a different Docker Compose file just for TorizonCore Builder; simply make sure your existing file is accessible according to the rules above.

For more on this, check these resources:

Best regards,
Toradex AI Assistant.

Thank you for clarifying. Another AI told me to always use absolute paths with torizoncore-builder. This makes more sense, but it also does not work.

I used “pwd” to print out the path that is being used to execute torizoncore-builder during the tcb-build task. As expected, it is the same as the pwd printed in my terminal in VSCode. In my terminal, I can access the file using the relative path. In tcbuild.yml, I cannot. Please help.

As I said in your other post: Exception in torizoncore-builder build

The tool due to being executed as a container, is unable to see file-paths above the directory it is being executed from.

Your path uses ../ which refers to the directory above the current one. Which as I’ve said the tool can’t see paths above the directory it is being executed from. Only paths in the same directory or lower can be seen.

Also please do not create multiple individual posts on this community about relative/absolute paths. It makes it more difficult to support you.

Best Regards,
Jeremias