AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • Início
  • system&network
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • Início
  • system&network
    • Recentes
    • Highest score
    • tags
  • Ubuntu
    • Recentes
    • Highest score
    • tags
  • Unix
    • Recentes
    • tags
  • DBA
    • Recentes
    • tags
  • Computer
    • Recentes
    • tags
  • Coding
    • Recentes
    • tags
Início / server / Perguntas / 1171896
Accepted
Dmitriano
Dmitriano
Asked: 2025-01-30 03:36:20 +0800 CST2025-01-30 03:36:20 +0800 CST 2025-01-30 03:36:20 +0800 CST

Não é possível instalar build-essential dentro de um contêiner Docker

  • 772

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.confno 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.confminha 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.confna máquina host.

Não entendo por que tenho dois diferentes resonv.confna 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
domain-name-system
  • 1 1 respostas
  • 110 Views

1 respostas

  • Voted
  1. Best Answer
    thecarpy
    2025-01-30T14:21:36+08:002025-01-30T14:21:36+08:00

    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-cacheignorará o cache.

    • 2

relate perguntas

Sidebar

Stats

  • Perguntas 205573
  • respostas 270741
  • best respostas 135370
  • utilizador 68524
  • Highest score
  • respostas
  • Marko Smith

    Você pode passar usuário/passar para autenticação básica HTTP em parâmetros de URL?

    • 5 respostas
  • Marko Smith

    Ping uma porta específica

    • 18 respostas
  • Marko Smith

    Verifique se a porta está aberta ou fechada em um servidor Linux?

    • 7 respostas
  • Marko Smith

    Como automatizar o login SSH com senha?

    • 10 respostas
  • Marko Smith

    Como posso dizer ao Git para Windows onde encontrar minha chave RSA privada?

    • 30 respostas
  • Marko Smith

    Qual é o nome de usuário/senha de superusuário padrão para postgres após uma nova instalação?

    • 5 respostas
  • Marko Smith

    Qual porta o SFTP usa?

    • 6 respostas
  • Marko Smith

    Linha de comando para listar usuários em um grupo do Windows Active Directory?

    • 9 respostas
  • Marko Smith

    O que é um arquivo Pem e como ele difere de outros formatos de arquivo de chave gerada pelo OpenSSL?

    • 3 respostas
  • Marko Smith

    Como determinar se uma variável bash está vazia?

    • 15 respostas
  • Martin Hope
    Davie Ping uma porta específica 2009-10-09 01:57:50 +0800 CST
  • Martin Hope
    kernel O scp pode copiar diretórios recursivamente? 2011-04-29 20:24:45 +0800 CST
  • Martin Hope
    Robert ssh retorna "Proprietário incorreto ou permissões em ~/.ssh/config" 2011-03-30 10:15:48 +0800 CST
  • Martin Hope
    Eonil Como automatizar o login SSH com senha? 2011-03-02 03:07:12 +0800 CST
  • Martin Hope
    gunwin Como lidar com um servidor comprometido? 2011-01-03 13:31:27 +0800 CST
  • Martin Hope
    Tom Feiner Como posso classificar a saída du -h por tamanho 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich O que é um arquivo Pem e como ele difere de outros formatos de arquivo de chave gerada pelo OpenSSL? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent Como determinar se uma variável bash está vazia? 2009-05-13 09:54:48 +0800 CST

Hot tag

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • Início
  • Perguntas
    • Recentes
    • Highest score
  • tag
  • help

Footer

AskOverflow.Dev

About Us

  • About Us
  • Contact Us

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve