docker / for-win

Bug reports for Docker Desktop for Windows
https://www.docker.com/products/docker#/windows
1.86k stars 289 forks source link

Unable to enable Add the *.docker.internal names to the host's etc/hosts file #13833

Open realtebo opened 10 months ago

realtebo commented 10 months ago

Description

Context:

On windows 11, I am running docker desktop using WSL2 engine.

I cannot activate the following highlighted option

Add the *.docker.internal names to the host's etc/hosts file (Requires password)

enter image description here

I already tried stopping engine I already tried restarting docker desktop as admin

enter image description here

"{\"message\":\"refreshing hosts: Post \\\"http://ipc/dns/refresh-hosts\\\": open \\\\\\\\.\\\\pipe\\\\dockerBackendV2: The system cannot find the file specified.\"}\n{\"message\":\"refreshing hosts: Post \\\"http://ipc/dns/refresh-hosts\\\": open \\\\\\\\.\\\\pipe\\\\dockerBackendV2: The system cannot find the file specified.\"}\n{\"message\":\"refreshing hosts: Post \\\"http://ipc/dns/refresh-hosts\\\": open \\\\\\\\.\\\\pipe\\\\dockerBackendV2: The system cannot find the file specified.\"}\n"

What's the problem ?

What is http://ipc/dns/refresh-hosts and why it's unable to be found on my machine?

Reproduce

Fresh install of docker desktop on windows 11, choosing WSL 2 as engine I don't know if it's reproducible on other machines

Expected behavior

I expected no errors

docker version

Client:
 Cloud integration: v1.0.35+desktop.5
 Version:           24.0.7
 API version:       1.43
 Go version:        go1.20.10
 Git commit:        afdd53b
 Built:             Thu Oct 26 09:08:44 2023
 OS/Arch:           windows/amd64
 Context:           default

Server: Docker Desktop 4.26.0 (130397)
 Engine:
  Version:          24.0.7
  API version:      1.43 (minimum version 1.12)
  Go version:       go1.20.10
  Git commit:       311b9ff
  Built:            Thu Oct 26 09:08:02 2023
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.25
  GitCommit:        d8f198a4ed8892c764191ef7b3b06d8a2eeb5c7f
 runc:
  Version:          1.1.10
  GitCommit:        v1.1.10-0-g18a0cb0
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

docker info

Client:
 Version:    24.0.7
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.12.0-desktop.2
    Path:     C:\Program Files\Docker\cli-plugins\docker-buildx.exe
  compose: Docker Compose (Docker Inc.)
    Version:  v2.23.3-desktop.2
    Path:     C:\Program Files\Docker\cli-plugins\docker-compose.exe
  dev: Docker Dev Environments (Docker Inc.)
    Version:  v0.1.0
    Path:     C:\Program Files\Docker\cli-plugins\docker-dev.exe
  extension: Manages Docker extensions (Docker Inc.)
    Version:  v0.2.21
    Path:     C:\Program Files\Docker\cli-plugins\docker-extension.exe
  feedback: Provide feedback, right in your terminal! (Docker Inc.)
    Version:  0.1
    Path:     C:\Program Files\Docker\cli-plugins\docker-feedback.exe
  init: Creates Docker-related starter files for your project (Docker Inc.)
    Version:  v0.1.0-beta.10
    Path:     C:\Program Files\Docker\cli-plugins\docker-init.exe
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc.)
    Version:  0.6.0
    Path:     C:\Program Files\Docker\cli-plugins\docker-sbom.exe
  scan: Docker Scan (Docker Inc.)
    Version:  v0.26.0
    Path:     C:\Program Files\Docker\cli-plugins\docker-scan.exe
  scout: Docker Scout (Docker Inc.)
    Version:  v1.2.0
    Path:     C:\Program Files\Docker\cli-plugins\docker-scout.exe

Server:
 Containers: 2
  Running: 1
  Paused: 0
  Stopped: 1
 Images: 2
 Server Version: 24.0.7
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: d8f198a4ed8892c764191ef7b3b06d8a2eeb5c7f
 runc version: v1.1.10-0-g18a0cb0
 init version: de40ad0
 Security Options:
  seccomp
   Profile: unconfined
 Kernel Version: 5.10.102.1-microsoft-standard-WSL2
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 7.69GiB
 Name: docker-desktop
 ID: 0bba259e-d99e-4812-ba89-17df297db71d
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 No Proxy: hubproxy.docker.internal
 Experimental: false
 Insecure Registries:
  hubproxy.docker.internal:5555
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No blkio throttle.read_bps_device support
WARNING: No blkio throttle.write_bps_device support
WARNING: No blkio throttle.read_iops_device support
WARNING: No blkio throttle.write_iops_device support
WARNING: daemon is not using the default seccomp profile

Diagnostics ID

B6692F37-5DCA-4444-9460-0ED81A40CDEF/20231207090845

Additional Info

No response

Afmc07 commented 9 months ago

I am having the exact same issue on Windows 10. I was not experiencing this when i performed a normal installation of Docker Desktop, i was suffering from an issue trying to run Go commands and saw that it could be related to docker desktop and to reinstall it in a different path like C:\Docker. After that the issue began.

manromcar commented 8 months ago

I am experimenting the same issue, has a way to fix it been found yet?

manromcar commented 8 months ago

I have found a solution to it. It seems that even if you have opened the application Docker Desktop, there are problems with the service associated to the app, and it doesn't start. To solve it, you have to follow these steps:

I hope this guide can help you and anyone with this or similar issues to fix it.

Thanks for your attention.

stoyanov-x commented 8 months ago

My experiments have shown that the DNS names work for some base OS images.

For example, it does not work for Server Core (e.g. IIS, ASP.NET Framework) while it does work on Server Nano (PowerShell Core, ASP.NET Core, etc.)