Error about container already in use while bundling

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 providing detailed output regarding your TorizonCore Builder issue.

Your error message indicates a conflict with a Docker container named /tcb-fetch-dind, which TorizonCore Builder uses for Docker-in-Docker operations. This type of conflict often appears even if you do not see the container in docker ps -a. It typically happens due to orphaned containers or inconsistent Docker contexts, especially after restarting your PC or switching between VS Code and a terminal.

Here are clear steps to resolve this issue:

1. Force Remove the Stuck Container

Even if it is not listed, try to force remove it by name:

docker rm -f tcb-fetch-dind

Or, if you have the container ID (from the error: a37f51d17af720790c9ba5a98f673d114532d5bcd83134a34b65b73e48b301d3):

docker rm -f a37f51d17af720790c9ba5a98f673d114532d5bcd83134a34b65b73e48b301d3

2. Remove the DinD Volume

There may also be a lingering volume (dind-volume) in use. Try:

docker volume rm dind-volume

If you get a “volume is in use” error, first ensure no containers are using it—removing the container above helps.

3. Verify Docker Context in VS Code

VS Code can use its own Docker context, which might differ from your terminal:

  • In the VS Code command palette, search for “Docker: Contexts” and ensure it is set to “default” (unless you know you’re using a specific context).

  • You can also check the DOCKER_HOST variable. In your VS Code terminal, run:

    echo $DOCKER_HOST
    

    If it is set, try unsetting it:

    unset DOCKER_HOST
    

Or, simply close and reopen VS Code after cleaning up containers above.

4. Restart Docker Daemon

After cleanup, restart Docker for good measure:

For Linux:

sudo systemctl restart docker

For Windows/Mac, restart Docker Desktop.

5. Prune Docker System (Optional and Destructive)

If the problem persists, prune all unused containers, volumes, networks, and images (this will remove unused stuff—be careful):

docker system prune -a --volumes

6. Alternative: Run From Command Line

If VS Code continues to have problems, try running your TorizonCore Builder operations in your system terminal or command prompt instead (not the VS Code integrated terminal) (source). Sometimes, context mismatches only occur in the VS Code terminal.


Once you have completed these steps, you should be able to build again. These steps address typical situations where a Docker context or orphaned container is causing a conflict.

Please let me know if you need further help or if this resolves the issue.
Best regards,
Toradex AI Assistant.

Reference: Docker container name conflict in TorizonCore Builder and VS Code context