ERROR: Get https://registry-1.docker.io/v2/: net/http: TLS handshake timeout in Docker
Error Overview
The error message “ERROR: Get https://registry-1.docker.io/v2/: net/http: TLS handshake timeout in Docker” indicates that there was a timeout during the TLS handshake when Docker attempted to connect to the Docker registry at https://registry-1.docker.io. This issue often arises due to network connectivity problems, slow internet connections, or misconfigured proxy settings.
Common Causes
Several factors can lead to this TLS handshake timeout error in Docker:
- Slow Internet Connection: A sluggish or unstable internet connection can hinder the TLS handshake process.
- Proxy Configuration: If Docker is operating behind a proxy, incorrect proxy settings can prevent it from establishing a connection to the Docker registry.
- Firewall Settings: Network firewalls may block Docker’s access to external URLs, leading to timeouts.
- DNS Issues: Problems with DNS resolution can prevent Docker from reaching the registry.
- Docker Daemon Issues: The Docker daemon may encounter problems that require a restart.
Solution Methods
Method 1: Restart the Docker Service
One of the simplest solutions is to restart the Docker service. Here’s how to do it:
- Open your terminal.
-
Execute the following command to restart Docker:
bash
sudo systemctl restart docker - After restarting, try pulling the Docker image again.
This method has resolved the issue for many users who faced the same TLS handshake timeout due to slow internet connections.
Method 2: Check Proxy Configuration
If you are operating behind a corporate proxy, ensure that your proxy settings are correctly configured. Follow these steps:
-
Open the Docker service configuration file. This can usually be found in
/etc/systemd/system/docker.serviceor similar paths depending on your installation. -
Add or modify the following lines under the
[Service]section:
ini
[Service]
Environment="HTTP_PROXY=http://pqr.corp.xxx.com:8080"
Environment="HTTPS_PROXY=https://pqr.corp.xxx.com:8080"
Environment="NO_PROXY=localhost,127.0.0.1" -
Save the file and restart the Docker service:
bash
sudo systemctl daemon-reload
sudo systemctl restart docker - Verify if the issue is resolved by attempting to pull an image.
Method 3: Change Docker Registry Mirror
In some cases, changing the Docker registry mirror can help bypass connectivity issues:
-
Open your Docker daemon configuration file, usually located at
/etc/docker/daemon.json. -
Add or modify the
registry-mirrorssection:
“`json

コメント