docker创建容器问题-docker run

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy-updates/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy-backports/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/jammy-security/InRelease  Temporary failure resolving 'security.ubuntu.com'
W: Failed to fetch https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/InRelease  Temporary failure resolving 'developer.download.nvidia.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.

docker run时遇到上述问题,可以看到是网络问题。

配置DNS解决:

vi /etc/docker/daemon.json

加入"dns": ["8.8.8.8"],

重启docker:

systemctl daemon-reload
systemctl restart docker.service

 

posted @ 2024-01-09 14:22  sunshine丶23  阅读(94)  评论(0编辑  收藏  举报