详细报错

➜  ~ docker pull docker.io/portainer/portainer
Using default tag: latest
Error response from daemon: Head "https://registry-1.docker.io/v2/portainer/portainer/manifests/latest": Get "https://auth.docker.io/token?scope=repository%3Aportainer%2Fportainer%3Apull&service=registry.docker.io": net/http: TLS handshake timeout

解决措施(MAC和Linux通用)

1、创建/etc/docker/daemon.json文件

daemon.json文件中配置阿里云镜像(或者其他的镜像)加速

mkdir /etc/docker
vi
//添加镜像内容如下
{
"registry-mirrors":["https://o208lp66.mirror.aliyuncs.com"]
}

2、重启docker即可

systemctl restart docker

MAC中使用上述命令可能会报如下错:

net/http: TLS handshake timeout -- Mac/Linux上 docker pull image拉取镜像超时问题_docker


在Docker Desktop中restart即可。

net/http: TLS handshake timeout -- Mac/Linux上 docker pull image拉取镜像超时问题_json_02

验证

再次执行docker pull 命令

net/http: TLS handshake timeout -- Mac/Linux上 docker pull image拉取镜像超时问题_json_03