root@a1ca2e87e348:/# apt update
Err:1 http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu focal InRelease
Temporary failure resolving 'mirrors.tuna.tsinghua.edu.cn'
Err:2 http://packages.ros.org/ros2/ubuntu focal InRelease
Temporary failure resolving 'packages.ros.org'
Err:3 https://mirrors.ustc.edu.cn/ubuntu focal InRelease
Temporary failure resolving 'mirrors.ustc.edu.cn'
Err:4 http://mirrors.tuna.tsinghua.edu.cn/ros2/ubuntu focal InRelease
Temporary failure resolving 'mirrors.tuna.tsinghua.edu.cn'
Err:5 https://mirrors.ustc.edu.cn/ubuntu focal-updates InRelease
Temporary failure resolving 'mirrors.ustc.edu.cn'
Err:6 https://mirrors.ustc.edu.cn/ubuntu focal-backports InRelease
Temporary failure resolving 'mirrors.ustc.edu.cn'
Err:7 https://mirrors.ustc.edu.cn/ubuntu focal-security InRelease
Temporary failure resolving 'mirrors.ustc.edu.cn'
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
W: Failed to fetch https://mirrors.ustc.edu.cn/ubuntu/dists/focal/InRelease Temporary failure resolving 'mirrors.ustc.edu.cn'
W: Failed to fetch https://mirrors.ustc.edu.cn/ubuntu/dists/focal-updates/InRelease Temporary failure resolving 'mirrors.ustc.edu.cn'
W: Failed to fetch https://mirrors.ustc.edu.cn/ubuntu/dists/focal-backports/InRelease Temporary failure resolving 'mirrors.ustc.edu.cn'
W: Failed to fetch https://mirrors.ustc.edu.cn/ubuntu/dists/focal-security/InRelease Temporary failure resolving 'mirrors.ustc.edu.cn'
W: Failed to fetch http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu/dists/focal/InRelease Temporary failure resolving 'mirrors.tuna.tsinghua.edu.cn'
W: Failed to fetch http://mirrors.tuna.tsinghua.edu.cn/ros2/ubuntu/dists/focal/InRelease Temporary failure resolving 'mirrors.tuna.tsinghua.edu.cn'
W: Failed to fetch http://packages.ros.org/ros2/ubuntu/dists/focal/InRelease Temporary failure resolving 'packages.ros.org'
W: Some index files failed to download. They have been ignored, or old ones used instead.
root@a1ca2e87e348:/# cat /etc/resolv.conf
# Generated by Docker Engine.
# This file can be edited; Docker Engine will not make further changes once it
# has been modified.
nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 114.114.114.114
search .
# Based on host file: '/run/systemd/resolve/resolv.conf' (legacy)
# Overrides: [nameservers]
dns没问题
root@xiegan-B650M-GAMING-WIFI:~# docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' a1ca2e87e348
172.17.0.2
root@xiegan-B650M-GAMING-WIFI:~# ping 172.17.0.2
PING 172.17.0.2 (172.17.0.2) 56(84) bytes of data.
64 bytes from 172.17.0.2: icmp_seq=1 ttl=64 time=0.063 ms
64 bytes from 172.17.0.2: icmp_seq=2 ttl=64 time=0.049 ms
64 bytes from 172.17.0.2: icmp_seq=3 ttl=64 time=0.046 ms
^C
--- 172.17.0.2 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2057ms
rtt min/avg/max/mdev = 0.046/0.052/0.063/0.007 ms
root@xiegan-B650M-GAMING-WIFI:~#
与主机联通
为什么我的docker内的noetic-desktop-full容器无法连接软件源