При обновлении apt-get контейнера Docker происходит сбой, но контейнер может без проблем проверять / скручивать ссылки

У меня есть докер-контейнер, который я пытаюсь построить. К сожалению, я не могу в него ничего установить. apt-get update вообще не работает. Странно то, что я могу скручивать файлы без проблем. Я не совсем понимаю, что здесь происходит.

Ping, похоже, работает нормально:

root@1605103d18c0:/# ping ports.ubuntu.com -c 3
PING ports.ubuntu.com (91.189.88.150) 56(84) bytes of data.
64 bytes from astomi.canonical.com (91.189.88.150): icmp_seq=1 ttl=51 time=91.2 ms
64 bytes from astomi.canonical.com (91.189.88.150): icmp_seq=2 ttl=51 time=89.3 ms
64 bytes from astomi.canonical.com (91.189.88.150): icmp_seq=3 ttl=51 time=88.4 ms

--- ports.ubuntu.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2000ms
rtt min/avg/max/mdev = 88.440/89.672/91.246/1.170 ms

curl работает нормально (я отправил его в wc -c , чтобы просто сообщить о загруженном размере)

root@1605103d18c0:/# curl http://ports.ubuntu.com/ubuntu-ports/dists/bionic/InRelease | wc -c
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  236k  100  236k    0     0   403k      0 --:--:-- --:--:-- --:--:--  403k
242048

apt update и apt-get update оба терпят неудачу с неспособностью разрешить.

root@1605103d18c0:/# apt update
Err:1 https://repo.nordvpn.com/deb/nordvpn/debian stable InRelease
  Temporary failure resolving 'repo.nordvpn.com'
Err:2 http://ports.ubuntu.com/ubuntu-ports bionic InRelease
  Temporary failure resolving 'ports.ubuntu.com'
Err:3 http://ports.ubuntu.com/ubuntu-ports bionic-updates InRelease
  Temporary failure resolving 'ports.ubuntu.com'
Err:4 http://ports.ubuntu.com/ubuntu-ports bionic-backports InRelease
  Temporary failure resolving 'ports.ubuntu.com'
Err:5 http://ports.ubuntu.com/ubuntu-ports bionic-security InRelease
  Temporary failure resolving 'ports.ubuntu.com'
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/bionic/InRelease  Temporary failure resolving 'ports.ubuntu.com'
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/bionic-updates/InRelease  Temporary failure resolving 'ports.ubuntu.com'
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/bionic-backports/InRelease  Temporary failure resolving 'ports.ubuntu.com'
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/bionic-security/InRelease  Temporary failure resolving 'ports.ubuntu.com'
W: Failed to fetch https://repo.nordvpn.com/deb/nordvpn/debian/dists/stable/InRelease  Temporary failure resolving 'repo.nordvpn.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.
0
задан 27 December 2019 в 09:21

1 ответ

docker-compose.yml

version: "3.7"
services:
  app:
    build:
      network: host
      dockerfile: dockerfiles/application.Dockerfile

Использовать хост-сеть

0
ответ дан 28 December 2019 в 09:19

Другие вопросы по тегам:

Похожие вопросы: