Torizon with docker bake

Hi,
I’m working on an application running in Torizon for a Colibri IMX6ULL V1.1A.
All works fine until an upgrade of my development system append.

I get this lines:
#1 [internal] load local bake definitions
#1 reading from stdin 883B done
#1 DONE 0.0s
failed to find target default

AI support drive me to a docker bake problem ( my docker version is 2.39.1) and advice me to put :
“DOCKER_BUILDKIT”: “0” in a appropriate place
This solved my issue but now each compilation rebuild the Torizon image by downloading all things.

How can I avoid this behavior ?

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 detailed description of the issue.

You’re observing that downgrading BuildKit by setting "DOCKER_BUILDKIT": "0" resolves the Docker bake issue with your Torizon application on the Colibri iMX6ULL, but now this causes the image layers to be rebuilt from scratch with each compilation. This leads to lengthy builds, as Docker cannot reuse previously built layers as it usually does.

Explanation

When you set "DOCKER_BUILDKIT": "0", Docker disables the newer BuildKit engine and reverts to the legacy builder. This older builder may behave differently, especially with multi-stage builds or more complex build chains as commonly seen in Torizon workflows. In such cases, Docker may not be able to cache intermediate layers efficiently, resulting in repeated downloads and builds.

Recommendations & Best Practices

  1. Re-enable BuildKit if Possible
    If you can, prefer using BuildKit (DOCKER_BUILDKIT=1) because it is designed for better caching and more efficient builds. Investigate whether your Docker bake issue can be resolved by updating your Docker files, bake definitions, or using a compatible Torizon IDE/extension version.

    Documentation for reference:

  2. Dockerfile & .dockerignore Distribution
    Ensure your Dockerfile and .dockerignore files are set up correctly. Unnecessary changes to files or lack of a .dockerignore may trigger Docker to invalidate its build cache.

  3. Use Docker Compose and TorizonCore Builder
    If your workflow allows, leverage Docker Compose and TorizonCore Builder workflow, which are well integrated with the Torizon platform and designed to maximize consistency and caching.

  4. Clean Up Old Docker Artifacts
    Sometimes issues arise from leftover or corrupted Docker cache layers. You can run:

    docker system prune
    

    (Be careful as this removes all unused images and containers.)

  5. Check Compatibility
    Make sure your Visual Studio Code IDE and Torizon Extension are up-to-date and compatible with your Docker version.

Summary

If you can share your docker-compose.yml or Docker command that triggers the error, I might be able to provide more targeted advice.

Best regards,
Toradex AI Assistant.

Hi @didier2018

Sorry, I was not able to understand your issue.

Can you elaborate on what you are trying to achieve here?

  1. What steps did you take?
  2. Are you following a specific article?