docker报错-无法解析 registry-1.docker.io

问题

执行docker的拉取容器命令docker pull xxxx,结果报无法解析 registry-1.docker.io的错误,如图

解决

修改/etc/resolv.conf文件,配置如下

bash 复制代码
# This file is managed by man:systemd-resolved(8). Do not edit.
#
# This is a dynamic resolv.conf file for connecting local clients to the
# internal DNS stub resolver of systemd-resolved. This file lists all
# configured search domains.
#
# Run "resolvectl status" to see details about the uplink DNS servers
# currently in use.
#
# Third party programs must not access this file directly, but only through the
# symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,
# replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.

#nameserver 127.0.0.53
nameserver 114.114.114.114
nameserver 8.8.8.8
相关推荐
画中有画21 小时前
软件架构中质量属性(性能、安全、可扩展性)的权衡设计
java·运维·安全
xrlfreedom21 小时前
大厂 MCP 面试实录:内部 REST API 封装为可审计 MCP Tools 的落地方案
docker·mcp·提示注入防护
NJCloud21 小时前
Ansible(三)——Zabbix 监控系统部署与敏感信息加密
linux·运维·chrome·信息可视化·ansible·zabbix
NJCloud1 天前
TiDB 集群部署与 MySQL 兼容性适配实战
linux·运维·数据库·mysql·tidb
2401_868534781 天前
UNIX常用命令英文全称与中文解释整理
linux·运维
摇滚侠1 天前
《Docker技术入门与实战 第4版》阅读笔记 2 Docker 镜像
笔记·docker·容器
云原生指北1 天前
Docker Sandboxes 工作区怎么接:Direct、Clone 和它们的边界
git·docker·agent
玉宇夕落1 天前
Docker + Nginx + Node.js 容器化部署 —— 从零到一理解反向代理与容器化原理
docker
lsh曙光1 天前
playbook剧本(2)--Ansible变量
linux·运维·网络
ly76891 天前
Docker 从入门到实践:镜像、容器、Dockerfile 与 Docker Compose 详解
运维·docker·容器