dockerdocker-registrydockerhub

Error response from daemon: Get "https://registry-1.docker.io/v2/": proxyconnect tcp: dial tcp: lookup proxy.example.com on 8.8.8.8:53: no such host


The error I got:

pegasus@pegasus:~/Downloads/Docker_deb$ sudo docker run hello-world
Unable to find image 'hello-world:latest' locally
docker: Error response from daemon: Get "https://registry-1.docker.io/v2/": proxyconnect tcp: dial tcp: lookup proxy.example.com on 8.8.8.8:53: no such host.
See 'docker run --help'.

I installed docker using this instructions: enter image description here

But when I use the following command I get error.

pegasus@pegasus:~/Downloads/Docker_deb$ sudo docker run hello-world
Unable to find image 'hello-world:latest' locally
docker: Error response from daemon: Get "https://registry-1.docker.io/v2/": proxyconnect tcp: dial tcp: lookup proxy.example.com on 8.8.8.8:53: no such host.
See 'docker run --help'.
pegasus@pegasus:~$ sudo dockerd --debug
INFO[2024-06-25T04:10:55.092883645+06:00] Starting up                                  
DEBU[2024-06-25T04:10:55.093453907+06:00] Listener created for HTTP on unix (/var/run/docker.sock) 
DEBU[2024-06-25T04:10:55.110352598+06:00] Golang's threads limit set to 110340         
DEBU[2024-06-25T04:10:55.110827666+06:00] metrics API listening on /var/run/docker/metrics.sock 
DEBU[2024-06-25T04:10:55.113904708+06:00] Using default logging driver json-file       
DEBU[2024-06-25T04:10:55.114060596+06:00] No quota support for local volumes in /var/lib/docker/volumes: Filesystem does not support, or has not enabled quotas 
DEBU[2024-06-25T04:10:55.114096006+06:00] processing event stream                       module=libcontainerd namespace=plugins.moby
DEBU[2024-06-25T04:10:56.076431002+06:00] Cleaning up old mountid : start.             
failed to start daemon: error while opening volume store metadata database (/var/lib/docker/volumes/metadata.db): timeout

Solution

  • My issue was solved by taking the following steps:

    I removed everything related to docker

    for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done
    
    sudo rm -rf /var/lib/docker/*
    
    sudo apt-get purge docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-ce-rootless-extras
    
    sudo rm -rf /var/lib/docker
    sudo rm -rf /var/lib/containerd
    

    Then installed docker like this:

    # Add Docker's official GPG key:
    sudo apt-get update
    sudo apt-get install ca-certificates curl
    sudo install -m 0755 -d /etc/apt/keyrings
    sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
    sudo chmod a+r /etc/apt/keyrings/docker.asc
    
    # Add the repository to Apt sources:
    echo \
      "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
      $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
      sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
    sudo apt-get update
    
    VERSION_STRING=5:26.1.0-1~ubuntu.24.04~noble
    sudo apt-get install docker-ce=$VERSION_STRING docker-ce-cli=$VERSION_STRING containerd.io docker-buildx-plugin docker-compose-plugin
    
    sudo snap install docker
    
    docker run hello-world
    

    N.B. You might need to add your user to docker group.