This is in a dev. environment on my Windows 11 computer. I’m trying to call from within the container REST services that run on my computer that hosts docker run...
Based on information I’d found on the web, I’d tried replacing “localhost” with “host.docker.internal” and now I’m getting System.Net.WebException: The remote name could not be resolved: 'host.docker.internal'
. Could anyone please enlighten me on how should I proceed? docker run --network="host"
does not work either, which is expected on Windows.
docker version
Client:
Cloud integration: v1.0.35+desktop.13
Version: 26.0.0
API version: 1.45
Go version: go1.21.8
Git commit: 2ae903e
Built: Wed Mar 20 15:18:56 2024
OS/Arch: windows/amd64
Context: default
Server: Docker Desktop 4.29.0 (145265)
Engine:
Version: 26.0.0
API version: 1.45 (minimum version 1.24)
Go version: go1.21.8
Git commit: 8b79278
Built: Wed Mar 20 15:17:49 2024
OS/Arch: windows/amd64
Experimental: false
This is fixed now. I upgraded Docker Desktop and now I can use http://host.docker.internal:8380/api/
to send REST requests to my dev. computer. My current Docker configuration is:
docker version
Client:
Version: 27.0.3
API version: 1.46
Go version: go1.21.11
Git commit: 7d4bcd8
Built: Sat Jun 29 00:03:32 2024
OS/Arch: windows/amd64
Context: desktop-windows
Server: Docker Desktop 4.32.0 (157355)
Engine:
Version: 27.0.3
API version: 1.46 (minimum version 1.24)
Go version: go1.21.11
Git commit: 662f78c
Built: Sat Jun 29 00:02:13 2024
OS/Arch: windows/amd64
Experimental: false