报错信息:Error response from daemon: Get "https://registry-1.docker.io/v2/": dial tcp
解决方案
1、有可能不能上网
cat /etc/resolv.conf
ping下百度,看能不能正常上网
ping baidu.com
是否存在DNS:nameserver 114.114.114.114
sudo vim /etc/netplan/00-installer-config.yaml
修改后如下
DNS服务器地址,多个DNS服务器地址需要用英文逗号分隔开,可不配置
nameservers:
addresses: [127.0.0.53,114.114.114.114]
# This is the network config written by 'subiquity'
network:
ethernets:
enp0s5:
dhcp4: true
nameservers:
addresses: [127.0.0.53,114.114.114.114]
version: 2
查看systemd-networkd服务状态(可选)
sudo systemctl status systemd-networkd
重启网络服务
sudo netplan apply
重新拉取正常
2、修改 docker 配置文件
新增或修改 /etc/docker/daemon.json
修改dns内容,"dns": ["114.114.114.114"]
{
"registry-mirrors":[
"https://ooe7wn09.mirror.aliyuncs.com",
"https://registry.docker-cn.com",
"http://hub-mirror.c.163.com",
"https://docker.mirrors.ustc.edu.cn"
],
"insecure-registries":[],
"dns": ["114.114.114.114", "8.8.8.8"]
}
重新拉取正常