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 / 1147459
Accepted
Raphael10
Raphael10
Asked: 2023-11-09 03:45:21 +0800 CST2023-11-09 03:45:21 +0800 CST 2023-11-09 03:45:21 +0800 CST

Ubuntu 22.04 Erro do daemon: Obtenha "https://registry-1.docker.io/v2/": disque tcp: procure registro-1.docker.io em 127.0.0.53:53: conexão recusada

  • 772

No Ubuntu 22.04

root@k8s-eu-1-master:~# sudo systemctl daemon-reload
root@k8s-eu-1-master:~# sudo systemctl enable docker
Synchronizing state of docker.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable docker
root@k8s-eu-1-master:~# 
root@k8s-eu-1-master:~# sudo systemctl restart docker
root@k8s-eu-1-master:~# 
root@k8s-eu-1-master:~# sudo docker pull cassandra:latest
Error response from daemon: Get "https://registry-1.docker.io/v2/": dial tcp: lookup registry-1.docker.io on 127.0.0.53:53: read udp 127.0.0.1:48086->127.0.0.53:53: read: connection refused

root@k8s-eu-1-master:~# sudo systemctl status docker
● docker.service - Docker Application Container Engine
     Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
     Active: active (running) since Wed 2023-11-08 20:22:55 CET; 11min ago
TriggeredBy: ● docker.socket
       Docs: https://docs.docker.com
   Main PID: 272072 (dockerd)
      Tasks: 15
     Memory: 37.7M
        CPU: 638ms
     CGroup: /system.slice/docker.service
             └─272072 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

Nov 08 20:22:55 k8s-eu-1-master dockerd[272072]: time="2023-11-08T20:22:55.320001583+01:00" level=info msg="Daemon has completed initialization"
Nov 08 20:22:55 k8s-eu-1-master dockerd[272072]: time="2023-11-08T20:22:55.353839818+01:00" level=info msg="API listen on /run/docker.sock"
Nov 08 20:22:55 k8s-eu-1-master systemd[1]: Started Docker Application Container Engine.
Nov 08 20:23:07 k8s-eu-1-master dockerd[272072]: time="2023-11-08T20:23:07.456049976+01:00" level=warning msg="Error getting v2 registry: Get \"https://registry-1.docker.io/v2/\": dial tcp: lookup registry-1.docker.io on 127.0.0.53:53: read udp 127.0.0.1:48086->127.0.0.53:53: read: connection refused"
Nov 08 20:23:07 k8s-eu-1-master dockerd[272072]: time="2023-11-08T20:23:07.456096778+01:00" level=info msg="Attempting next endpoint for pull after error: Get \"https://registry-1.docker.io/v2/\": dial tcp: lookup registry-1.docker.io on 127.0.0.53:53: read udp 127.0.0.1:48086->127.0.0.53:53: read: connection refused"
Nov 08 20:23:07 k8s-eu-1-master dockerd[272072]: time="2023-11-08T20:23:07.458039838+01:00" level=error msg="Handler for POST /v1.43/images/create returned error: Get \"https://registry-1.docker.io/v2/\": dial tcp: lookup registry-1.docker.io on 127.0.0.53:53: read udp 127.0.0.1:48086->127.0.0.53:53: read: connection refused"
Nov 08 20:32:06 k8s-eu-1-master dockerd[272072]: time="2023-11-08T20:32:06.231824815+01:00" level=warning msg="Error getting v2 registry: Get \"https://registry-1.docker.io/v2/\": dial tcp: lookup registry-1.docker.io on 127.0.0.53:53: read udp 127.0.0.1:43104->127.0.0.53:53: read: connection refused"
Nov 08 20:32:06 k8s-eu-1-master dockerd[272072]: time="2023-11-08T20:32:06.231929019+01:00" level=info msg="Attempting next endpoint for pull after error: Get \"https://registry-1.docker.io/v2/\": dial tcp: lookup registry-1.docker.io on 127.0.0.53:53: read udp 127.0.0.1:43104->127.0.0.53:53: read: connection refused"
Nov 08 20:32:06 k8s-eu-1-master dockerd[272072]: time="2023-11-08T20:32:06.233897769+01:00" level=error msg="Handler for POST /v1.43/images/create returned error: Get \"https://registry-1.docker.io/v2/\": dial tcp: lookup registry-1.docker.io on 127.0.0.53:53: read udp 127.0.0.1:43104->127.0.0.53:53: read: connection refused"
Nov 08 20:32:10 k8s-eu-1-master dockerd[272072]: time="2023-11-08T20:32:10.259620826+01:00" level=info msg="ignoring event" container=544ab9c3758d8293d505aead2429bd2a6fff065672bc83c171d4834393814dc6 module=libcontainerd namespace=moby topic=/tasks/delete type="*events.TaskDelete"

Mas o hello-worldexemplo do docker funciona bem:

root@k8s-eu-1-master:~# docker run hello-world

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/

Esta é a saída de docker info:

root@k8s-eu-1-master:~# docker info
    Client: Docker Engine - Community
     Version:    24.0.7
     Context:    default
     Debug Mode: false
     Plugins:
      buildx: Docker Buildx (Docker Inc.)
        Version:  v0.11.2
        Path:     /usr/libexec/docker/cli-plugins/docker-buildx
      compose: Docker Compose (Docker Inc.)
        Version:  v2.21.0
        Path:     /usr/libexec/docker/cli-plugins/docker-compose
    
    Server:
     Containers: 4
      Running: 0
      Paused: 0
      Stopped: 4
     Images: 1
     Server Version: 24.0.7
     Storage Driver: overlay2
      Backing Filesystem: extfs
      Supports d_type: true
      Using metacopy: false
      Native Overlay Diff: true
      userxattr: false
     Logging Driver: json-file
     Cgroup Driver: systemd
     Cgroup Version: 2
     Plugins:
      Volume: local
      Network: bridge host ipvlan macvlan null overlay
      Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
     Swarm: inactive
     Runtimes: io.containerd.runc.v2 runc
     Default Runtime: runc
     Init Binary: docker-init
     containerd version: 61f9fd88f79f081d64d6fa3bb1a0dc71ec870523
     runc version: v1.1.9-0-gccaecfc
     init version: de40ad0
     Security Options:
      apparmor
      seccomp
       Profile: builtin
      cgroupns
     Kernel Version: 5.15.0-88-generic
     Operating System: Ubuntu 22.04.3 LTS
     OSType: linux
     Architecture: x86_64
     CPUs: 10
     Total Memory: 58.86GiB
     Name: k8s-eu-1-master
     ID: ca48bc0b-922b-47b6-bae4-85d5d911436c
     Docker Root Dir: /var/lib/docker
     Debug Mode: false
     Experimental: false
     Insecure Registries:
      127.0.0.0/8
     Live Restore Enabled: false

Como fazer dar certo?

docker
  • 2 2 respostas
  • 568 Views

2 respostas

  • Voted
  1. Best Answer
    Márcio Galeno
    2024-01-14T10:26:34+08:002024-01-14T10:26:34+08:00

    Tive o mesmo problema ao fazer um docker build, foi resolvido com o comando abaixo que @Raphael10 postou.

     vi /etc/resolv.conf
     nameserver 8.8.8.8
     nameserver 8.8.4.4
    
    • 1
  2. Raphael10
    2023-11-09T03:51:48+08:002023-11-09T03:51:48+08:00

    Resolvido adicionando essas duas linhas em /etc/resolv.conf

        nameserver 8.8.8.8
        nameserver 8.8.4.4
    

    E então:

        root@k8s-eu-1-master:~# sudo systemctl daemon-reload
        root@k8s-eu-1-master:~# sudo systemctl restart docker
    
    • 0

relate perguntas

  • Ainda confuso por que o docker funciona quando você faz um processo ouvir 0.0.0.0, mas não 127.0.0.1

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