Docker container registry not using port 5002

I am having trouble debugging my project in VSCode. I am getting the following error when attempting a debug:

Executing task: xonsh .conf/validate-deps-running.xsh 

/home/sabrahamian/.local/pipx/venvs/xonsh/lib/python3.11/site-packages/xonsh/environ.py:2816: DeprecationWarning: env: Setting deprecated env variable 'RAISE_SUBPROC_ERROR'. Replace it to 'XONSH_SUBPROC_CMD_RAISE_ERROR'.
  self._set_item(key, val)

⚠️ VALIDATING ENVIRONMENT

OS:         Linux
OS Version: 6.18.33.1-microsoft-standard-WSL2
OS Arch:    x86_64
Under WSL:  Torizon
VS Code:
1.125.1
fcf604774b9f2674b473065736ee75077e256353
x64

TOR Extension:  toradex.apollox-vscode@3.6.0

❌ Docker container registry is not using port 5002!
Maybe there is some conflict with another container using the same name/port

Error cause: Not configured


 *  The terminal process "xonsh '.conf/validate-deps-running.xsh'" terminated with exit code: 1. 
 *  Terminal will be reused by tasks, press any key to close it. 

When looking at what process has reserved port 5002 I found this:

C:\Windows\System32>netstat -aon | findstr :5002
  TCP    0.0.0.0:5002           0.0.0.0:0              LISTENING       11820

C:\Windows\System32>tasklist /FI "PID eq 11820"

Image Name                     PID Session Name        Session#    Mem Usage
========================= ======== ================ =========== ============
svchost.exe                  11820 Services                   0      4,404 K

Results of tdx-info:

torizon@verdin-am62-15600960:~$ sudo tdx-info
Password:

Software summary
------------------------------------------------------------
Bootloader:               U-Boot
Kernel version:           6.6.119-7.5.0-gf1f810e373a1 #1-Torizon SMP PREEMPT Fri
 Dec 12 14:50:07 UTC 2025
Kernel command line:      root=LABEL=otaroot rootfstype=ext4 quiet logo.nologo v
t.global_cursor_default=0 plymouth.ignore-serial-consoles splash fbcon=map:3 ost
ree=/ostree/boot.1/torizon/e76a56a5773fe116fb14057ad60f27ff78d4262fc1f5af17ed330
042685004bc/0
Distro name:              NAME="Torizon OS"
Distro version:           VERSION_ID=7.5.0-build.30
Distro variant:           VARIANT="Docker"
Hostname:                 verdin-am62-15600960
------------------------------------------------------------

Hardware info
------------------------------------------------------------
HW model:                 Toradex Verdin AM62 on Verdin Development Board
Toradex version:          0074 V1.2A
Serial number:            15600960
Processor arch:           aarch64
------------------------------------------------------------

I tired following the instructions from this thread.

I checked the Torizon IDE startup tasks run-docker-registry, run-torizon-binfmt, and run-share-wsl-ports all report that each task succeeded.

I ran the docker login command, successfully logged in, and ran the following command:

docker run --rm -it --privileged torizon/binfmt:latest

And I got the following response:

Unable to find image ‘torizon/binfmt:latest’ locally
latest: Pulling from torizon/binfmt
8aabc323a91f: Pull complete
26b478ce1ac7: Pull complete
06f8d3fb0cee: Pull complete
Digest: sha256:4341763f8efc917a9ca02dfb9f6f0fdf53116a6358dcab0b363a03c6a0f69788
Status: Downloaded newer image for torizon/binfmt:latest
WARNING: The requested image’s platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
exec /usr/bin/binfmt: exec format error

This initial error is confusing, I then checked my arm emulation with this command:

docker run --rm -it --pull always --platform linux/arm64/v8 debian arch

I got the reply:

latest: Pulling from library/debian
ed660e1af0f5: Pull complete
Digest: sha256:fe7312b5f05bf5f43fad76bcd8945642e4e47a68aefd1b73f447615899d0fac1
Status: Downloaded newer image for debian:latest
aarch64

So there shouldn’t be an issue here. I checked to see if the registry is running with the following command:

docker ps | grep registry

I got no response. So I attempted to restart the registry with the following commands:

🐧 sabrahamian @MU69-PC~/mudelcontroller: docker stop registry || true
Error response from daemon: No such container: registry
🐧 sabrahamian @MU69-PC~/mudelcontroller: docker rm registry || true
Error response from daemon: No such container: registry
🐧 sabrahamian @MU69-PC~/mudelcontroller: docker run -d -p 5002:5000 --restart=always --name registry registry:2
Unable to find image ‘registry:2’ locally
2: Pulling from library/registry
95459497489f: Pull complete
8bbaad1488a8: Pull complete
9a6b3f59ebc2: Pull complete
bd39ca3613a6: Pull complete
ddcb6d98388d: Pull complete
Digest: sha256:a3d8aaa63ed8681a604f1dea0aa03f100d5895b6a58ace528858a7b332415373
Status: Downloaded newer image for registry:2
bf06403ffa5ed78a64193b0ead937f2dc1e50d81f3eb1d18ac46b2843db0d224

I then reloaded the VSCode window and still got the same error that I received initially. What am I doing wrong?

Hi, I’m the Toradex AI Assistant.

I might make mistakes or occasionally get you wrong. Our support team will step in if needed.


Based on your error message and troubleshooting steps, the issue appears to be that the Docker registry container is running but may not be accessible from the WSL environment on port 5002. Here are some steps to resolve this:

Verify Registry Container Status

First, confirm the registry container is actually running:

docker ps -a | grep registry

You mentioned running docker run -d -p 5002:5000 --restart=always --name registry registry:2 which should have started it. Check if it’s running with:

docker logs registry

WSL Port Forwarding Issue

The fact that Windows svchost.exe is listening on port 5002 suggests a port conflict. In WSL 2, port forwarding from Windows to WSL can be problematic. The extension includes a script specifically for this(1).

The .conf/share-wsl-ports.xsh script is designed to “open the firewall from the Windows side and be possible to access the WSL ports from the target device”(1). However, you mentioned this task succeeded, which may not be the full picture.

Resolution Steps

  1. Stop the Windows process on port 5002 (if safe to do so):

    • Identify what service svchost.exe PID 11820 is running
    • You may need to restart Windows or change the registry port
  2. Verify the registry is accessible from WSL:

    curl http://localhost:5002/v2/_catalog
    
  3. Check VS Code settings:
    Look at .vscode/settings.json to confirm the registry port configuration matches 5002(1).

  4. Restart Docker Desktop (if using Docker Desktop for Windows):

    • This often resolves WSL 2 networking issues
    • After restart, manually start the registry again
  5. Alternative: Change the registry port:
    If port 5002 is persistently blocked, you could modify the port in your VS Code settings and restart the registry on a different port (e.g., 5003).

Could you confirm which version of Torizon OS and which specific hardware you’re using? This will help me provide more targeted guidance. You can get this information using the tdx-info command on your device, which you’ve already run - I can see you’re using Torizon OS 7.5.0 on Verdin AM62.

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.

@ToradexAI

The results of tdx-info:

Software summary
------------------------------------------------------------
Bootloader:               U-Boot
Kernel version:           6.6.119-7.5.0-gf1f810e373a1 #1-Torizon SMP PREEMPT Fri
 Dec 12 14:50:07 UTC 2025
Kernel command line:      root=LABEL=otaroot rootfstype=ext4 quiet logo.nologo v
t.global_cursor_default=0 plymouth.ignore-serial-consoles splash fbcon=map:3 ost
ree=/ostree/boot.1/torizon/e76a56a5773fe116fb14057ad60f27ff78d4262fc1f5af17ed330
042685004bc/0
Distro name:              NAME="Torizon OS"
Distro version:           VERSION_ID=7.5.0-build.30
Distro variant:           VARIANT="Docker"
Hostname:                 verdin-am62-15600960
------------------------------------------------------------

Hardware info
------------------------------------------------------------
HW model:                 Toradex Verdin AM62 on Verdin Development Board
Toradex version:          0074 V1.2A
Serial number:            15600960
Processor arch:           aarch64
------------------------------------------------------------

Running the command docker ps -a | grep registry

I get the response:

bf06403ffa5e registry:2 “/entrypoint.sh /etc…” 5 minutes ago Up 5 minutes 0.0.0.0:5002->5000/tcp, [::]:5002->5000/tcp registry

Running the command docker logs registry

I get the response:

time=“2026-06-23T15:32:49.788069213Z” level=info msg=“Starting upload purge in 45m0s” go.version=go1.20.8 instance.id=718097dc-63f2-4f02-9206-215e58e1b7b2 service=registry version=2.8.3
time=“2026-06-23T15:32:49.787800989Z” level=warning msg=“No HTTP secret provided - generated random secret. This may cause problems with uploads if multiple registries are behind a load-balancer. To provide a shared secret, fill in http.secret in the configuration file or set the REGISTRY_HTTP_SECRET environment variable.” go.version=go1.20.8 instance.id=718097dc-63f2-4f02-9206-215e58e1b7b2 service=registry version=2.8.3
time=“2026-06-23T15:32:49.788612547Z” level=info msg=“redis not configured” go.version=go1.20.8 instance.id=718097dc-63f2-4f02-9206-215e58e1b7b2 service=registry version=2.8.3
time=“2026-06-23T15:32:49.789376916Z” level=info msg=“using inmemory blob descriptor cache” go.version=go1.20.8 instance.id=718097dc-63f2-4f02-9206-215e58e1b7b2 service=registry version=2.8.3
time=“2026-06-23T15:32:49.790936343Z” level=info msg=“listening on [::]:5000” go.version=go1.20.8 instance.id=718097dc-63f2-4f02-9206-215e58e1b7b2 service=registry version=2.8.3

Running the command curl http://localhost:5002/v2/_catalog
I get the reply: curl: (52) Empty reply from server

Thank you for the additional information. The registry container is running correctly on your WSL side (listening on port 5000 internally, mapped to 5002 externally). However, the curl: (52) Empty reply from server error indicates a connectivity issue between WSL and the registry.

Root Cause Analysis

The problem appears to be WSL 2 networking-related. Your registry is running inside WSL, but the validation script is checking connectivity, and there’s a Windows svchost.exe process occupying port 5002, which may be interfering with port forwarding from Windows to WSL.

Resolution Steps

1. Verify WSL Networking

First, test if the registry is accessible from within WSL:

curl http://127.0.0.1:5002/v2/_catalog

If this works but localhost doesn’t, it’s a DNS resolution issue within WSL.

2. Check Host IP Configuration

The Torizon IDE Extension uses the host_ip setting to share the local Docker registry namespace with your Torizon device(1). Verify this is set correctly in .vscode/settings.json:

"host_ip": "<your-wsl-ip-address>"

You can find your WSL IP address with:

ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1

3. Restart WSL Networking

Sometimes WSL 2 networking gets into a bad state. Try restarting WSL from PowerShell (as Administrator):

wsl --shutdown

Then restart your WSL distribution and the registry:

docker start registry

4. Alternative: Use Docker Desktop’s Built-in Registry

If the issue persists, you might need to configure Docker Desktop to properly expose the registry. However, since you mentioned using Docker Engine (recommended approach(2)), ensure you’re not mixing Docker Desktop and Docker Engine installations.

5. Verify ARM Emulation

I notice you got an exec format error when running the binfmt container. You should run it with the correct platform specification(2):

docker run --rm -it --privileged torizon/binfmt

Note: No :latest tag needed, and the platform should be auto-detected.

6. Check Extension Tasks

Re-run the Torizon IDE startup tasks manually:

  • run-docker-registry
  • run-share-wsl-ports

Pay close attention to any warnings or errors in the task output.

Windows Port Conflict

The Windows svchost.exe on port 5002 is likely causing the issue. You have two options:

  1. Identify and stop the conflicting service (may require admin privileges)
  2. Change the registry port: Modify your project to use a different port (e.g., 5003) by updating the registry startup command and VS Code settings

If none of these steps resolve the issue, please share:

  • The output of curl http://127.0.0.1:5002/v2/_catalog from within WSL
  • Your .vscode/settings.json file (specifically the host_ip value)
  • The full output of the run-share-wsl-ports task

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.

@ToradexAI

After sending the command curl http://127.0.0.1:5002/v2/_catalog

I got the same reply as before curl: (52) Empty reply from server

My host IP does match the “host_ip“ value in my settings.json file.

I closed VSCode, shutdown WSL and restarted it with the commands provided.

C:\Windows\System32>wsl sudo service docker status
Docker is not running … failed!

C:\Windows\System32>wsl sudo service docker start
Starting Docker: docker.

C:\Windows\System32>wsl docker start registry
registry

C:\Windows\System32>wsl sudo service docker status
Docker is running.

C:\Windows\System32>wsl docker ps
CONTAINER ID   IMAGE        COMMAND                  CREATED       STATUS          PORTS     NAMES
5cfc16d9e91d   registry:2   “/entrypoint.sh /etc…”   10 days ago   Up 30 seconds             registry

I restarted VSCode and attempted to debug again and got the same error as before:

Docker container registry is not using port 5002!
Maybe there is some conflict with another container using the same name/port

Error cause: Not configured


The results of run-docker-registry

Executing task: /home/sabrahamian/.local/bin/xonsh /home/sabrahamian/mudelcontroller/.conf/run-container-if-not-exists.xsh --container-runtime docker --run-arguments “-d -p 5002:5000 --restart=always registry:2” --container-name registry

/home/sabrahamian/.local/pipx/venvs/xonsh/lib/python3.11/site-packages/xonsh/environ.py:2816: DeprecationWarning: env: Setting deprecated env variable ‘RAISE_SUBPROC_ERROR’. Replace it to ‘XONSH_SUBPROC_CMD_RAISE_ERROR’.
self._set_item(key, val)
Container Runtime: docker
Run Arguments: -d -p 5002:5000 --restart=always registry:2
Container Name: registry
Container registry already created
Checking if container registry is running…
Container registry is already running.

Terminal will be reused by tasks, press any key to close it.

The results of run-torizon-binfmt

Executing task: xonsh /home/sabrahamian/mudelcontroller/.conf/run-container-if-not-exists.xsh --container-runtime docker --run-arguments “–rm --privileged torizon/binfmt:latest” --container-name binfmt

/home/sabrahamian/.local/pipx/venvs/xonsh/lib/python3.11/site-packages/xonsh/environ.py:2816: DeprecationWarning: env: Setting deprecated env variable ‘RAISE_SUBPROC_ERROR’. Replace it to ‘XONSH_SUBPROC_CMD_RAISE_ERROR’.
self._set_item(key, val)
Container Runtime: docker
Run Arguments: --rm --privileged torizon/binfmt:latest
Container Name: binfmt
Container does not exist. Starting …
Cmd: docker run --name binfmt --rm --privileged torizon/binfmt:latest

Terminal will be reused by tasks, press any key to close it.

The results of run-share-wsl-ports

Executing task: xonsh /home/sabrahamian/mudelcontroller/.conf/share-wsl-ports.xsh /home/sabrahamian/mudelcontroller

/home/sabrahamian/.local/pipx/venvs/xonsh/lib/python3.11/site-packages/xonsh/environ.py:2816: DeprecationWarning: env: Setting deprecated env variable ‘RAISE_SUBPROC_ERROR’. Replace it to ‘XONSH_SUBPROC_CMD_RAISE_ERROR’.
self._set_item(key, val)
Using WSL interface eth0 (IP: 10.85.76.208)

Terminal will be reused by tasks, press any key to close it.

I did notice that the port tab in VSCode, it indicates no forwarded ports.

image

image518×192 3.52 KB

This seems like an issue.

Thank you for the detailed troubleshooting output. The issue is now clearer - the registry container is running, but there’s a connectivity problem preventing the validation script from confirming it’s properly accessible on port 5002.

Key Findings

Based on your output:

  1. Registry is running: The container is up and listening internally on port 5000, mapped to 5002 externally
  2. WSL networking issue: curl: (52) Empty reply from server indicates the connection is being established but immediately closed
  3. No port forwarding in VS Code: This is significant - VS Code’s port forwarding feature isn’t active

Root Cause

The “Empty reply from server” error typically means:

  • The registry container is running but not responding correctly
  • There may be a Docker networking misconfiguration
  • The registry might need to be configured as an insecure registry(1)

Resolution Steps

1. Configure Docker for Insecure Registry

Since your registry is running over HTTP (not HTTPS), Docker needs to be explicitly configured to allow this(1). Create or modify /etc/docker/daemon.json in your WSL environment:

{
  "insecure-registries" : ["localhost:5002", "127.0.0.1:5002", "10.85.76.208:5002"]
}

(1)

After editing, restart Docker:

sudo service docker restart

2. Verify Registry Accessibility

Test the registry with a more verbose curl command:

curl -v http://127.0.0.1:5002/v2/

The expected response should be {} with HTTP 200 status(1).

3. Check for Docker Network Issues

Your registry container might be using the wrong network mode. Stop and recreate it with explicit host network access:

docker stop registry
docker rm registry
docker run -d -p 5002:5000 --restart=always --name registry registry:2

(1)

4. Verify Host IP Setting

Your host_ip setting should match your WSL IP address. According to your run-share-wsl-ports output, your WSL IP is 10.85.76.208(2). Verify this in .vscode/settings.json:

"host_ip": "10.85.76.208"

(2)

5. Address the Windows Port Conflict

The Windows svchost.exe process on port 5002 is likely blocking proper port forwarding. You have two options:

Option A: Use a different port (recommended for quick resolution):

docker stop registry
docker rm registry
docker run -d -p 5003:5000 --restart=always --name registry registry:2

Then update your VS Code settings to use port 5003 instead of 5002.

Option B: Identify and stop the Windows service using port 5002 (requires admin privileges).

Additional Troubleshooting

If the issue persists, there might be a Docker 29 compatibility issue. According to the troubleshooting documentation, Docker v29 can cause platform manifest problems(3). Consider checking your Docker version:

docker --version

If you’re running Docker v29, the Torizon IDE Extension version 3.3.114 (pre-release) addresses this issue(3).

Could you try the insecure registry configuration and let me know if curl -v http://127.0.0.1:5002/v2/ returns a valid response after restarting Docker?

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.

@ToradexAI

I created /etc/docker/daemon.json, restarted the docker service using sudo service docker restart, and ran the verbose curl command and this was the response:

🐧 sabrahamian @MU69-PC~: curl -v http://127.0.0.1:5002/v2/

Trying 127.0.0.1:5002…

Connected to 127.0.0.1 (127.0.0.1) port 5002 (#0)

GET /v2/ HTTP/1.1
Host: 127.0.0.1:5002
User-Agent: curl/7.88.1
Accept: /

Empty reply from server

Closing connection 0

I then ran these commands and got this response:

🐧 sabrahamian @MU69-PC~: docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
5cfc16d9e91d registry:2 “/entrypoint.sh /etc…” 11 days ago Up 41 seconds registry
🐧 sabrahamian @MU69-PC~: docker stop registry
registry
🐧 sabrahamian @MU69-PC~: docker rm registry
registry
🐧 sabrahamian @MU69-PC~: docker run -d -p 5002:5000 --restart=always --name registry registry:2
be17b6d0c18e4070d280bd85872c45a06205e61c61f552031b64af755bff6846
docker: Error response from daemon: failed to set up container networking: driver failed programming external connectivity on endpoint registry (928b82b803ed0758a9271636cbd518edadbd9df2fc732f58a0d59fcf5bbb73aa): failed to bind host port 0.0.0.0:5002/tcp: address already in use

I then reloaded the VSCode window and got an error in the initialization of the Torizon IDE extension.

[06-23 16:06:24.133] Activating Torizon IDE ...

[06-23 16:06:24.133] Torizon IDE version :: 3.6.0

[06-23 16:06:25.268] Latest Torizon IDE published :: 3.6.105

[06-23 16:06:25.268] Telemetry is enabled

[06-23 16:06:25.268] Extension collects completely anonymous telemetry data about templates usage. Participation in this anonymous program is optional, and you may opt-out if you'd not like to share any information. Check: 


[06-23 16:06:25.268] Telemetry allows us to accurately gauge templates usage. This data will help us to focus better on the most used templates, adding new features and putting effort in the right place.

[06-23 16:06:25.268] Resolving host IP address ...

[06-23 16:06:26.090] Host IP address OK

[06-23 16:06:26.090] Bash as default shell OK

[06-23 16:06:26.098] Docker installed OK

[06-23 16:06:26.128] ERROR :: Docker is not running. Please start the Docker runtime daemon

[06-23 16:06:26.220] Docker compose OK

[06-23 16:06:26.242] WARNING :: PowerShell Core is not installed.

[06-23 16:06:26.258] git OK

[06-23 16:06:26.291] dig OK

[06-23 16:06:26.298] avahi-resolve OK

[06-23 16:06:26.305] nmap OK

[06-23 16:06:26.336] iputils-ping OK

[06-23 16:06:26.347] file OK

[06-23 16:06:26.359] sshpass OK

[06-23 16:06:26.395] iproute2 OK

[06-23 16:06:26.405] rsync OK

[06-23 16:06:26.418] python3 OK

[06-23 16:06:26.434] pipx OK

[06-23 16:06:26.435] Cloning project templates

[06-23 16:06:26.435] Templates repo: 


[06-23 16:06:26.435] Templates branch: bookworm-7

[06-23 16:06:26.435] Templates tag/hash: bookworm-7

[06-23 16:06:26.449] Project templates clone of branch bookworm-7 OK

[06-23 16:06:26.596] Project templates fetched OK

[06-23 16:06:26.617] Checkout templates repo to tag origin/bookworm-7 OK

[06-23 16:06:34.283] xonsh installation OK

[06-23 16:06:34.283] WARNING :: PowerShell is not installed, if you are using Torizon v6.x.x or templates from Torizon v6.x.x, PowerShell is required.

[06-23 16:06:34.285] WARNING :: Project name not found in workspace metadata for single container workspace, or it matches the workspace name.

[06-23 16:06:34.286] Checking connected devices ...

[06-23 16:06:34.286] Scanning Torizon devices ...

[06-23 16:06:34.294] Debian bookworm packages list load OK

[06-23 16:06:34.294] Debug id_rsa OK

[06-23 16:06:34.294] ERROR :: Errors during the initialization of Torizon IDE Extension.

[06-23 16:06:34.294] HOUSTON WE HAVE A PROBLEM!

[06-23 16:06:34.294] PLEASE READ THE LOGS!

[06-23 16:06:34.294] ERROR :: Please share this log on https://community.toradex.com

[06-23 16:06:34.318] Error scanning devices: Not possible to get docker network gateway

[06-23 16:06:34.378] Checking host ip sanity ...

[06-23 16:06:35.990] Host ip is OK

[06-23 16:06:36.041] Device 10.85.76.239 set as Docker Host

I can provide the console log if requested.

Thank you for the detailed logs. The error messages reveal the core issue:

  1. Port 5002 is already in use: failed to bind host port 0.0.0.0:5002/tcp: address already in use
  2. Docker networking issue: Not possible to get docker network gateway
  3. Docker daemon appears stopped: Docker is not running. Please start the Docker runtime daemon

Immediate Resolution

1. Restart Docker Service

The extension detected Docker is not running. Start it:

sudo service docker start
sudo service docker status

[(1)](https://developer.toradex.com/torizon/application-development/ide-extension/set-up-the-ide-ext2-environment)

2. Identify What Is Using Port 5002

Since the registry container failed to start due to port conflict, check what's using it:

sudo lsof -i :5002

Or:

sudo netstat -tulpn | grep 5002

The old registry container might still be bound to the port even though you removed it. This can happen when Docker networking gets into an inconsistent state.

3. Clean Docker Networking

Restart Docker to clear any stale network bindings:

sudo service docker stop
sudo service docker start

[(1)](https://developer.toradex.com/torizon/application-development/ide-extension/set-up-the-ide-ext2-environment)

4. Recreate the Registry Container

After Docker restarts, try creating the registry again:

docker run -d -p 5002:5000 --restart=always --name registry registry:2

[(2)](https://developer.toradex.com/torizon/application-development/working-with-containers/store-and-share-container-images)

5. Verify Registry Is Responding

Test the registry endpoint:

curl -v http://127.0.0.1:5002/v2/

You should see {} as the response, not "Empty reply from server"[(2)](https://developer.toradex.com/torizon/application-development/working-with-containers/store-and-share-container-images).

Alternative Approach: Use a Different Port

Given the persistent port 5002 conflict (both from Windows svchost.exe and now within WSL), I recommend using a different port:

Step 1: Create Registry on Port 5003

docker stop registry || true
docker rm registry || true
docker run -d -p 5003:5000 --restart=always --name registry registry:2

[(2)](https://developer.toradex.com/torizon/application-development/working-with-containers/store-and-share-container-images)

Step 2: Update daemon.json

Edit /etc/docker/daemon.json:

{
  "insecure-registries" : ["localhost:5003", "127.0.0.1:5003", "10.85.76.208:5003"]
}

[(2)](https://developer.toradex.com/torizon/application-development/working-with-containers/store-and-share-container-images)

Step 3: Restart Docker

sudo service docker restart

[(1)](https://developer.toradex.com/torizon/application-development/ide-extension/set-up-the-ide-ext2-environment)

Step 4: Update VS Code Configuration

Modify the run-docker-registry task in your project's .conf/run-container-if-not-exists.xsh or the task definition to use port 5003 instead of 5002[(3)](https://developer.toradex.com/torizon/application-development/ide-extension/create-torizon-project).

Docker Networking Gateway Issue

The error Not possible to get docker network gateway suggests Docker's bridge network isn't properly initialized. This can happen when:

  • Docker daemon crashes or restarts improperly
  • WSL networking gets into an inconsistent state

To resolve this, after restarting Docker, verify the bridge network exists:

docker network ls
docker network inspect bridge

The bridge network should show a valid gateway IP (typically 172.17.0.1).

Next Steps

  1. Restart Docker service completely
  2. Either resolve the port 5002 conflict or switch to port 5003
  3. Verify the registry responds correctly to curl http://127.0.0.1:5003/v2/ (or 5002)
  4. Reload VS Code window

Could you try restarting Docker, checking what's using port 5002 with lsof, and let me know the results?

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.

Greetings @SAbrahamian,

On initial impression it appears there’s something wrong with the Docker setup you have in WSL. Are you using our WSL 2 distro, or a different distro?

The fact that the IDE extension can’t tell if Docker is running or not in your WSL distro might also suggest an issue with WSL configuration as well. Maybe as a sanity test, trying to reset/reinstall the WSL distro you are using.

Best Regards,
Jeremias

@jeremias.tx I am using the Toradex distro. No other distro’s are installed. Recently I has having issues connecting to WSL through the Torizon extension.

I couldn’t figure out how to reinstall the Toradex distro in WSL so I ended up uninstalling everything and reinstalled it, making sure to run the installation wizard when installing the Torizon IDE extension.

Would a console log help?

I see from your previous thread after reinstalling things, your system was working correctly according to you. Are you saying after that previous reinstall it’s not working again?

Did something change or did you configure anything differently after the last recent reinstall?

Also, I see your previous response was marked as a solution. Did you do that? Is the issue now resolved on your end?

Best Regards,
Jeremias

@jeremias.tx I should have been clearer in my previous post. After the issue with the IDE not properly connecting to WSL, uninstalling and reinstalling everything fixed that connection issue. I’m still having conflict issue with port 5002.

I’ve tried killing the process that is reserving port 5002 to no avail. Svchost.exe reserves port 5002 again and another PID is assigned. I will try changing the port number in VSCode to see if that solves the issue.

@jeremias.tx I was able to fix it to get the docker container registry set to port 5003.

I had to edit the following files to change all references to port 5002 to port 5003:

docker-compose.yml, settings.json, tasks.json, create-docker-compose-production.xsh, share-wsl-ports.xsh, spin-up-down-registry.xsh, and validate-deps-running.xsh

I am able to get further through the debugging process. I do have another error I need to figure out but the Docker container registry port has been successfully changed.

Glad to hear you were able to get around it by changing the port. Though I wonder why you had that other process on port 5002. I haven’t heard from other Window users about such a port conflict.

Best Regards,
Jeremias