Docker pull microsoft/nanoserver Error response from daemon: Get https://registry-1.docker.io/v2/: proxyconnect tcp: read tcp <windowsserverip>:62296-><proxyip>:<proxyport>: wsarecv: An existing connection was forcibly closed by the remote host

Expected behavior

Docker should be able to pull images

Actual behavior

Docker pull command fails with following error
Error response from daemon: Get https://registry-1.docker.io/v2/: proxyconnect tcp: read tcp <-windowsserverip>:62296-><-proxyip>:<-proxyport>: wsarecv: An existing connection was forcibly closed by the remote host.

Information

  • host distribution and version Windows Server 2016 Standard Version 1607 (OS Build 14393.2248)

Steps to reproduce the behavior

  1. …Install docker on windows server 2016
    Install-Module -Name DockerMsftProvider -Repository PSGallery –Force
    Install-Package -Name docker -ProviderName DockerMsftProvider
    Restart-Computer -Force

  2. …Run docker pull command
    docker pull microsoft/nanoserver

Issue is fixed, the catch was proxy environment variable. Removing HTTPS_PROXY environment variable worked for me. correct proxy config env variable for me was -
HTTP_PROXY http://