现象:
Error response from daemon: Head https://registry-1.docker.io/v2/library/php/manifests/latest: Get https://auth.docker.io/token?scope=repository%3Alibrary%2Fphp%3Apull&service=registry.docker.io: read tcp 192.168.31.127:56324->54.161.109.204:443: read: connection reset by peer
使用 docker pull php ,出现connection reset by peer报错
解决办法:
配置镜像加速器,可以注册阿里云,使用阿里云镜像加速
在阿里云页面搜索容器镜像服务
sudo mkdir -p /etc/docker sudo tee /etc/docker/daemon.json <<-'EOF' { "registry-mirrors": ["https://xxxxx.mirror.aliyuncs.com"] } EOF sudo systemctl daemon-reload sudo systemctl restart docker
可以增加多个镜像仓库地址
sudo tee /etc/docker/daemon.json <<-'EOF' { "registry-mirrors": ["https://xxxxx.mirror.aliyuncs.com","http://hub-mirror.c.163.com","https://docker.mirrors.ustc.edu.cn","https://registry.docker-cn.com"] } EOF
结果:问题解决