Docker: setup proxy to download images

I need setup the corporation proxy in order Docker can download the images from public registry.

$ sudo docker run hello-world 
Unable to find image 'hello-world:latest' locally 
Pulling repository 
Error while pulling image: Get dial tcp: lookup no such host

I’m using Ubuntu 12.04 machine. I have found this answer but systemctl is not present in Ubuntu 12.04. How can I do this?

  • Docker-plugin on Jenkins fails to Test Connection
  • Dockerfile, how to create images ubuntu 14.04
  • Docker behind VPN cannot start after downloading TFS container
  • Docker with Node.js and Express.js
  • Package.json not found while running inside docker
  • Docker: uwsgi service not recognised
  • Thanks.

  • Docker service does not start
  • regex string doesn't seem to work in ELK stack
  • How to list docker mounted volumes from within the container
  • How to remove old Docker containers
  • Loopback handle connection issues (and startup crashes)
  • How to update a Kubernetes deployment on Google Container Engine?
  • 2 Solutions collect form web for “Docker: setup proxy to download images”

    I was getting the following error while trying to run the hello-world container

    $docker run hello-world
    Unable to find image 'hello-world:latest' locally
    docker: Error response from daemon: Get dial tcp getsockopt: no route to host.

    I tried the steps in the following link which worked for me with respect to HTTPS or HTTP configuration

    Edit /etc/defaults/ and add the following lines:

    export http_proxy='http://user:password@proxy-host:proxy-port'

    Then restart docker daemon:

    sudo service restart


    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.