Configuring corp proxy for Docker on Oracle VM VirtualBox












0















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)









share|improve this question

























  • 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?

    – Karthik Prasad
    Jan 3 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.

    – M06H
    Jan 3 at 13:16
















0















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)









share|improve this question

























  • 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?

    – Karthik Prasad
    Jan 3 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.

    – M06H
    Jan 3 at 13:16














0












0








0








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)









share|improve this question
















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)






docker virtualbox docker-machine boot2docker






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 3 at 9:54







M06H

















asked Jan 2 at 16:46









M06HM06H

5822827




5822827













  • 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?

    – Karthik Prasad
    Jan 3 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.

    – M06H
    Jan 3 at 13:16



















  • 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?

    – Karthik Prasad
    Jan 3 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.

    – M06H
    Jan 3 at 13:16

















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?

– Karthik Prasad
Jan 3 at 13:12





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?

– Karthik Prasad
Jan 3 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.

– M06H
Jan 3 at 13:16





First - VM with docker installed. This is the setup as per docker toolbox installation from docker site which comes with VM setup.

– M06H
Jan 3 at 13:16












1 Answer
1






active

oldest

votes


















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






share|improve this answer
























  • would this be at top level .docker directory where I create config.json or in the C:Usersuser123.dockermachinemachinesexample ? there is already a config.json in the latter

    – M06H
    Jan 4 at 14:32













  • Yes top level directory

    – Karthik Prasad
    Jan 4 at 19:45











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54010102%2fconfiguring-corp-proxy-for-docker-on-oracle-vm-virtualbox%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









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






share|improve this answer
























  • would this be at top level .docker directory where I create config.json or in the C:Usersuser123.dockermachinemachinesexample ? there is already a config.json in the latter

    – M06H
    Jan 4 at 14:32













  • Yes top level directory

    – Karthik Prasad
    Jan 4 at 19:45
















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






share|improve this answer
























  • would this be at top level .docker directory where I create config.json or in the C:Usersuser123.dockermachinemachinesexample ? there is already a config.json in the latter

    – M06H
    Jan 4 at 14:32













  • Yes top level directory

    – Karthik Prasad
    Jan 4 at 19:45














0












0








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






share|improve this answer













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







share|improve this answer












share|improve this answer



share|improve this answer










answered Jan 3 at 13:27









Karthik PrasadKarthik Prasad

6,69553769




6,69553769













  • would this be at top level .docker directory where I create config.json or in the C:Usersuser123.dockermachinemachinesexample ? there is already a config.json in the latter

    – M06H
    Jan 4 at 14:32













  • Yes top level directory

    – Karthik Prasad
    Jan 4 at 19:45



















  • would this be at top level .docker directory where I create config.json or in the C:Usersuser123.dockermachinemachinesexample ? there is already a config.json in the latter

    – M06H
    Jan 4 at 14:32













  • Yes top level directory

    – Karthik Prasad
    Jan 4 at 19:45

















would this be at top level .docker directory where I create config.json or in the C:Usersuser123.dockermachinemachinesexample ? there is already a config.json in the latter

– M06H
Jan 4 at 14:32







would this be at top level .docker directory where I create config.json or in the C:Usersuser123.dockermachinemachinesexample ? there is already a config.json in the latter

– M06H
Jan 4 at 14:32















Yes top level directory

– Karthik Prasad
Jan 4 at 19:45





Yes top level directory

– Karthik Prasad
Jan 4 at 19:45




















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54010102%2fconfiguring-corp-proxy-for-docker-on-oracle-vm-virtualbox%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

MongoDB - Not Authorized To Execute Command

How to fix TextFormField cause rebuild widget in Flutter

Npm cannot find a required file even through it is in the searched directory