Recebo o seguinte erro:
3.033 Err:32 http://security.ubuntu.com/ubuntu noble-updates/main amd64 linux-libc-dev amd64 6.8.0-51.52
3.034 404 Not Found [IP: 91.189.91.82 80]
ao tentar executar o seguinte comando dentro de um contêiner Docker:
FROM ubuntu:24.04
RUN apt update
RUN apt upgrade
RUN apt -y install build-essential
É um problema relacionado ao DNS?
/etc/resolv.conf
no contêiner Docker:
# Generated by Docker Engine.
# This file can be edited; Docker Engine will not make further changes once it
# has been modified.
nameserver 172.236.0.51
nameserver 172.236.0.54
nameserver 172.236.0.48
nameserver 172.236.0.46
nameserver 172.236.0.50
nameserver 172.236.0.47
nameserver 172.236.0.53
nameserver 172.236.0.52
nameserver 172.236.0.45
nameserver 172.236.0.49
search members.linode.com ip.linodeusercontent.com
# Based on host file: '/run/systemd/resolve/resolv.conf' (legacy)
# Overrides: []
é diferente da /etc/resolv.conf
minha máquina host (Ubuntu 24.04):
ll /etc/resolv.conf
lrwxrwxrwx 1 root root 37 Jan 23 18:19 /etc/resolv.conf -> /run/systemd/resolve/stub-resolv.conf
cat /etc/resolv.conf
nameserver 127.0.0.53
options edns0 trust-ad
search members.linode.com ip.linodeusercontent.com
mas corresponde /run/systemd/resolve/resolv.conf
na máquina host.
Não entendo por que tenho dois diferentes resonv.conf
na minha máquina host.
Também não está claro o suficiente se o DNS dentro do contêiner do Docker está configurado corretamente ou não.
EDITAR1
Rotas no contêiner Docker:
ip route show
default via 172.17.0.1 dev eth0
172.17.0.0/16 dev eth0 proto kernel scope link src 172.17.0.3
Rotas na máquina host:
ip route show
default via 172.236.29.1 dev eth0 proto dhcp src 172.236.29.157 metric 1024
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1
172.18.0.0/16 dev br-7c0ebcfd4e3a proto kernel scope link src 172.18.0.1
172.20.0.0/16 dev br-99d8bde8e488 proto kernel scope link src 172.20.0.1
172.236.0.45 via 172.236.29.1 dev eth0 proto dhcp src 172.236.29.157 metric 1024
172.236.0.46 via 172.236.29.1 dev eth0 proto dhcp src 172.236.29.157 metric 1024
172.236.0.47 via 172.236.29.1 dev eth0 proto dhcp src 172.236.29.157 metric 1024
172.236.0.48 via 172.236.29.1 dev eth0 proto dhcp src 172.236.29.157 metric 1024
172.236.0.49 via 172.236.29.1 dev eth0 proto dhcp src 172.236.29.157 metric 1024
172.236.0.50 via 172.236.29.1 dev eth0 proto dhcp src 172.236.29.157 metric 1024
172.236.0.51 via 172.236.29.1 dev eth0 proto dhcp src 172.236.29.157 metric 1024
172.236.0.52 via 172.236.29.1 dev eth0 proto dhcp src 172.236.29.157 metric 1024
172.236.0.53 via 172.236.29.1 dev eth0 proto dhcp src 172.236.29.157 metric 1024
172.236.0.54 via 172.236.29.1 dev eth0 proto dhcp src 172.236.29.157 metric 1024
172.236.29.0/24 dev eth0 proto kernel scope link src 172.236.29.157 metric 1024
172.236.29.1 dev eth0 proto dhcp scope link src 172.236.29.157 metric 1024
Do contêiner Docker:
ping 91.189.91.82
PING 91.189.91.82 (91.189.91.82) 56(84) bytes of data.
64 bytes from 91.189.91.82: icmp_seq=1 ttl=47 time=82.5 ms
64 bytes from 91.189.91.82: icmp_seq=2 ttl=47 time=82.6 ms
telnet security.ubuntu.com 80
Trying 91.189.91.81...
Connected to security.ubuntu.com.
Escape character is '^]'.
^]
telnet> quit
Connection closed.
EDITAR2
Do contêiner Docker:
root@4e534b3b6847:/# apt install --no-cache linux-libc-dev
E: Command line option --no-cache is not understood in combination with the other options
root@4e534b3b6847:/# df -h
Filesystem Size Used Avail Use% Mounted on
overlay 49G 34G 15G 70% /
tmpfs 64M 0 64M 0% /dev
shm 64M 0 64M 0% /dev/shm
/dev/sda 49G 34G 15G 70% /etc/hosts
tmpfs 985M 0 985M 0% /proc/acpi
tmpfs 985M 0 985M 0% /proc/scsi
tmpfs 985M 0 985M 0% /sys/firmware
root@4e534b3b6847:/# apt clean
root@4e534b3b6847:/# apt install linux-libc-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
linux-libc-dev
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 1,769 kB of archives.
After this operation, 7,508 kB of additional disk space will be used.
Ign:1 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 linux-libc-dev amd64 6.8.0-51.52
Err:1 http://security.ubuntu.com/ubuntu noble-updates/main amd64 linux-libc-dev amd64 6.8.0-51.52
404 Not Found [IP: 185.125.190.82 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/l/linux/linux-libc-dev_6.8.0-51.52_amd64.deb 404 Not Found [IP: 185.125.190.82 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
EDITAR3
Na máquina host:
$ apt-cache policy linux-libc-dev
linux-libc-dev:
Installed: 6.8.0-52.53
Candidate: 6.8.0-52.53
Version table:
*** 6.8.0-52.53 500
500 http://mirrors.linode.com/ubuntu noble-updates/main amd64 Packages
500 http://security.ubuntu.com/ubuntu noble-security/main amd64 Packages
100 /var/lib/dpkg/status
6.8.0-31.31 500
500 http://mirrors.linode.com/ubuntu noble/main amd64 Packages
No contêiner Docker:
# apt-cache policy linux-libc-dev
linux-libc-dev:
Installed: (none)
Candidate: 6.8.0-51.52
Version table:
6.8.0-51.52 500
500 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 Packages
500 http://security.ubuntu.com/ubuntu noble-security/main amd64 Packages
6.8.0-31.31 500
500 http://archive.ubuntu.com/ubuntu noble/main amd64 Packages
Quando verifiquei o repositório ontem, o Packages.gz estava datado de 29/01/2025, hoje está datado de 30/01/2025 04:21.
Gerald Schneider acertou em cheio! Você foi vítima da atualização do repositório.
Atualização após comentário:
docker armazena em cache de builds anteriores, neste caso, o cache contém dados obsoletos. Executar
docker build --no-cache
ignorará o cache.