Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dependency on DockerNAT interface in Docker Desktop for Windows #1276

Closed
lmakarov opened this issue Feb 11, 2020 · 3 comments
Closed
Assignees
Labels
Projects

Comments

@lmakarov
Copy link
Member

From https://docs.docker.com/docker-for-windows/release-notes/ for Docker Desktop Community 2.2.0.3

Known issues
DockerNAT has been removed from Docker Desktop 2.2.0.0 as using an IP address to communicate from the host to a container is not a supported feature. To communicate from a container to the host, you must use the special DNS name host.docker.internal. We also recommend using ports to communicate from the host to a container. For more information, see Networking.

However, if your current setup relies on IP addresses for communication, you can use a temporary workaround to reinstate DockerNAT. To do this, open C:\Program Files\Docker\Docker\resources\MobyLinux.ps1 and add $SwitchName = "DockerNAT" between line 175 and 176. Note that the temporary workaround to reinstate DockerNAT may be removed from future releases.

Upstream discussion: docker/for-win#5538

While Docksal does not use the DockerNAT interface for host to container communications, the interface is used to configure Docksal DNS for the host machine.

The long term solution for this compatibility issue will likely be #1215

@lmakarov lmakarov self-assigned this Feb 11, 2020
@lmakarov lmakarov added this to To do in 1.14.0 via automation Feb 11, 2020
@davekopecek
Copy link
Contributor

With WSL & docker desktop 2.2.0.3(42716) installed the temporary workaround above did not work. It resulted in:

docker: Error response from daemon: driver failed programming external connectivity on endpoint docksal-vhost-proxy (301b3a7bcea9294f3456c3f24fd2571b92db74a92571eb57a7b7d95d679e10e0): Error starting userland proxy: listen tcp 192.168.64.100:443: bind: cannot assign requested address.

Downgrading to docker 2.1.0.5 per #1268 seems the best bet while all this gets sorted.

@lmakarov lmakarov removed this from To do in 1.14.0 May 13, 2020
@lmakarov lmakarov added this to To do in 1.15.0 via automation May 13, 2020
lmakarov pushed a commit that referenced this issue May 14, 2020
Use the external docksal.site domain instead of the internal one. This is necessary to have a working setup out of the box without the need to ask the user to manually configure DNS records using "fin hosts".

See #1276
@lmakarov
Copy link
Member Author

There may be a super simple.

Apparently, Windows does have a loop interface adapter (Loopback Pseudo-Interface 1), which we can use instead of the DockerNAT adapter:

C:\Windows\system32>netsh.exe interface ip show addresses

Configuration for interface "Ethernet0"
    DHCP enabled:                         Yes
    IP Address:                           192.168.81.130
    Subnet Prefix:                        192.168.81.0/24 (mask 255.255.255.0)
    Default Gateway:                      192.168.81.2
    Gateway Metric:                       0
    InterfaceMetric:                      25

Configuration for interface "Loopback Pseudo-Interface 1"
    DHCP enabled:                         No
    IP Address:                           127.0.0.1
    Subnet Prefix:                        127.0.0.0/8 (mask 255.0.0.0)
    InterfaceMetric:                      75

Configuration for interface "vEthernet (Default Switch)"
    DHCP enabled:                         No
    IP Address:                           172.17.149.81
    Subnet Prefix:                        172.17.149.80/28 (mask 255.255.255.240)
    InterfaceMetric:                      5000

We can just switch to using this interphase for network configuration (Docksal IP assignment).

C:\Windows\system32>netsh.exe interface ip show addresses "Loopback Pseudo-Interface 1"

Configuration for interface "Loopback Pseudo-Interface 1"
    DHCP enabled:                         No
    IP Address:                           192.168.64.1
    Subnet Prefix:                        192.168.64.0/24 (mask 255.255.255.0)
    IP Address:                           192.168.64.100
    Subnet Prefix:                        192.168.64.0/24 (mask 255.255.255.0)
    IP Address:                           127.0.0.1
    Subnet Prefix:                        127.0.0.0/8 (mask 255.0.0.0)
    InterfaceMetric:                      10

lmakarov pushed a commit that referenced this issue May 14, 2020
Use the external docksal.site domain instead of the internal one. This is necessary to have a working setup out of the box without the need to ask the user to manually configure DNS records using "fin hosts".

See #1276
@lmakarov lmakarov removed this from To do in 1.15.0 May 14, 2020
@lmakarov lmakarov added this to Done in 1.13.3 May 14, 2020
@lmakarov
Copy link
Member Author

Should be fixed in v1.13.3 (just released).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
1.13.3
  
Done
Development

No branches or pull requests

2 participants