TCB-builder Getting exceptions when trying to bundle my image

I can see the core issue from your debug logs! The DIND container is trying to connect to 127.0.0.1:5002 from within its own network namespace, but 127.0.0.1 inside the container doesn’t resolve to your WSL host where the registry is running.

WSL Network Isolation Problem

The key error in your logs shows (1):

DinD> time="2026-02-19T18:04:18.225670929Z" level=info msg="Error logging in to endpoint, trying next endpoint" error="Get "https://127.0.0.1:5002/v2/\": dial tcp 127.0.0.1:5002: connect: connection refused"

This confirms that the DIND container cannot reach your WSL registry at 127.0.0.1:5002.

Solutions for WSL Environment

Solution 1: Use WSL Host IP Address

Instead of 127.0.0.1:5002, you need to find your WSL host’s actual IP address. In WSL, run:

ip route show | grep default

Then use that IP address in your command (1):

torizoncore-builder bundle docker-compose.yml --platform linux/arm64 --login-to <WSL_HOST_IP>:5002 myusername mypassword --dind-param="--insecure-registry=<WSL_HOST_IP>:5002"

Solution 2: Configure Registry for Docker Bridge Network

The DIND container runs on Docker’s bridge network. You need to make your registry accessible from that network. Check your registry configuration to ensure it binds to 0.0.0.0:5002 instead of just 127.0.0.1:5002 (2).

Solution 3: Use Docker Host Gateway

In some WSL configurations, you can use the Docker host gateway (2):

torizoncore-builder bundle docker-compose.yml --platform linux/arm64 --login-to host.docker.internal:5002 myusername mypassword --dind-param="--insecure-registry=host.docker.internal:5002"

Solution 4: Network Mode Configuration

Try running TorizonCore Builder with host network mode by setting the appropriate DIND parameters (1):

torizoncore-builder bundle docker-compose.yml --platform linux/arm64 --dind-param="--network=host" --dind-param="--insecure-registry=127.0.0.1:5002" --login-to 127.0.0.1:5002 myusername mypassword

Solution 5: Alternative Registry Setup

Consider setting up your registry to be accessible from the Docker bridge network. In your registry configuration, ensure it binds to all interfaces (2):

# In your registry docker-compose or configuration
ports:
  - "0.0.0.0:5002:5000"  # Instead of "127.0.0.1:5002:5000"

Recommended Approach

  1. First, find your WSL host IP address using ip route show | grep default
  2. Update your docker-compose.yml to use <WSL_HOST_IP>:5002/gimbals:runme instead of 127.0.0.1:5002/gimbals:runme
  3. Use the corrected command with the WSL host IP

The fundamental issue is network isolation between the DIND container and your WSL host. The 127.0.0.1 address inside the container refers to the container itself, not your WSL host where the registry is running (3).

Best regards, Toradex AI Assistant.


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

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.