I added a remote Docker context over ssh to my Windows 10 installation of Docker but executing any kind of command that has to contact the remote server takes at least 30 ish seconds before getting any kind of response. λ docker container ls ~ took 33s and λ docker info ~ took 34s
λ docker --debug container ls
msg="commandconn: starting ssh with [-o ConnectTimeout=30 -- myremote docker system dial-stdio]"
msg="commandconn: starting ssh with [-o ConnectTimeout=30 -- myremote docker system dial-stdio]"
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
~ took 33s
I created the exact same remote Docker context on one of my Linux installations, and the command execution works perfectly, almost instantly.
I assume this is some kind of Docker issue specific to Windows and my have something to do with some kind of timeout setting, since it’s pretty much always 30 seconds no matter which command is executed.
I have already tried:
Disabling my AV
Adding an AV exception to WSL
Enabling/disabling any kind of VPN
Disabling IPv6 on all of my network interfaces
Rebooting
Reinstalling Docker desktop
Updating the docker engine running on the remote host
Disabling opt-out usage statistics
Disabling NetBIOS.
Any kind of help that might push me in the right direction is very appreciated
I don’t know what it could be, but have you tried to check Windows Event Logs? Or maybe change the ConnectTimeout? I can’t imagine how that would affect the response time, but that seems to be 30 seconds
When invoking the docker container ls command, Docker will invoke the SSH command with the -o ConnectTimeout=30 option.
Invoking the SSH command myself with the -o ConnectTimeout=30 option leads to a 30-second delay; changing the value to 15 for example, will lead to a 15-second delay.
Searching through some issues on the PowerShell OpenSSH repository, I found that this weird behavior seems to be an issue with OpenSSH that should be resolved in the OpenSSH version 8.6. Which is the latest version that is installed on a Windows 11 machine; unfortunately, the latest available version for Windows 10 seems to be 8.1.
To resolve this, one has to probably manually uninstall the currently installed OpenSSH version and install a newer release from the PowerShell OpenSSH GitHub.
Just wanted to say thank you and confirm that proposed solution works.
After downloading and installing latest version from Releases · PowerShell/Win32-OpenSSH · GitHub and restarting all cmd instances, remote docker commands are now executing without any delay.