skip to Main Content

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

2

Answers


  1. Chosen as BEST ANSWER

    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.


  2. Have a look in the /etc/docker/daemon.json file. The only way i can get docker to replicate this behaviour is to set the following in the daemon.json

    root@vps-b21d2eed:/etc/docker# cat daemon.json
    {
      "proxies": {
        "http-proxy": "http://proxy.example.com:3128",
        "https-proxy": "https://proxy.example.com:3129",
        "no-proxy": "*.test.example.com,.example.org,127.0.0.0/8"
      }
    }
    

    After i restart the docker service I get this error

    root@vps-b21d2eed:/etc/docker# docker run -it  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 127.0.0.53:53: no such host.
    See 'docker run --help'.
    

    if i remove the proxy config in the daemon.json then run sudo systemctl restart docker then it works again

    
    root@vps-b21d2eed:/etc/docker# docker pull hello-world
    Using default tag: latest
    latest: Pulling from library/hello-world
    Digest: sha256:94323f3e5e09a8b9515d74337010375a456c909543e1ff1538f5116d38ab3989
    Status: Image is up to date for hello-world:latest
    docker.io/library/hello-world:latest
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search