1

I am looking to build a sample project with docker:

docker build -t helloworld .

But then, I get the following:

>docker build -t helloworld .
Sending build context to Docker daemon  2.048kB
Step 1/2 : FROM java
Get https://registry-1.docker.io/v2/: dial tcp: lookup registry-1.docker.io on 10.0.2.3:53: no such host

I am behind a corporate proxy. I guess I need to configure HTTP/HTTPS proxy from where docker is running and I am trying to setup the environment variable as documented here: docker proxy settings and many other online resources.

However, as I am using Windows 7, I used Docker Toolbox and successfully created a virtual box with this:

docker-machine create -d=virtualbox docker4java

But this creates a VM but without the systemctl. So I am not sure what different setups I need to do when using Oracle VM Virtual box.

Please note: I also followed the advice of changing the nameserver on /etc/resolve.conf file to 8.8.8.8 and this makes no difference only a different error:

Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
2
  • You have virtual box VM with docker installed with docker instance, and you need internet access for docker instance or docker with virtual box as docker instance, and you need internet access to virtual box VMs? Commented Jan 3, 2019 at 13:12
  • First - VM with docker installed. This is the setup as per docker toolbox installation from docker site which comes with VM setup. Commented Jan 3, 2019 at 13:16

1 Answer 1

0

This worked for me, create .docker directory in your home directory(home directory of user with which docker service is started), inside the .docker directory create config.json file with below configuration. and then restart the docker service.

{
 "proxies":
 {
   "default":
   {
     "httpProxy": "http://myproxy.server.com:8080/",
     "httpsProxy": "http://myproxy.server.com:8080/",
     "noProxy": "my.jenkins.com"
   }
 }
}

Note: my docker version is 18.06.1-ce and API version 1.38

Sign up to request clarification or add additional context in comments.

2 Comments

would this be at top level .docker directory where I create config.json or in the C:\Users\user123\.docker\machine\machines\example ? there is already a config.json in the latter
Yes top level directory

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.