Thursday, September 12, 2019

Troubleshoot Docker registry login timeout issue for Docker Toolbox

topic

Solve error:
docker registry login net/http: request canceled while waiting for connection (Client.Timeout exceeded...
especially
docker azure registry login net/http: request canceled while waiting for connection (Client.Timeout exceeded..
when wanting to log to a Docker registry while using the Docker tool box.

Introduction

If you want to work with Docker using a Windows 10 OS, Home version, you won't be allowed by the installation program to install Docker desktop. Docker desktop needs Hyper V and although Hyper V is now available even on Windows 10 Home, the Docker desktop installation program still checks only the OS version. If it doesn't find a Pro or an Enterprise version on your computer, it stops installation.
Fortunately you can performs the main Docker tasks using Docker tool box.

Error reason

The "Client.Timeout exceeded" issue while attempting to login to a Docker registry is due to a bad network configuration of your Docker Toolbox. When installing Docker Toolbox a default Virtual Box VM is also installed to your computer with 2 networks adapters. It is located at: drive\user\.docker\machine\machines\default



you can open it with Oracle Virtual Box that is also installed with the Docker Toolbox. If you open Settings and Network you will see the 2 adapters.



Warning: If you play with the virtual box and close it, you will close also the connection to your running containers. It is like disable the network adapter that allows you to connect to the running containers and test them locally. If you have this issue, close the docker Toolbox and restart it. A new connection and IP address will be reallocated:









Troubleshouting the issue

For troubleshooting the timeout issue you have to configure the Virtual Box Network Adapters.

Open the settings of Windows 10
Go to Network & Internet settings:



then, Change adapter options



then double click on VirtualBox Host-Only Network
Properties
Select Internet Protocol Version 4
Open properties
Set the DNS to 8 8 8 8

It should fix the timeout issue.



do the same for VirtualBox Host-Only Network # 2

It seems that it has solved also connection troubles for the Docker Extension of Visual Studio Code.



No comments: