Search code examples
dockerwindows-7docker-toolbox

Docker proxy settings in docker toolbox


We are using Windows OS 7 to develop an application using tech stack viz. docker, spring, java8, gradle etc. We have installed the docker toolbox on our machine.

Now the base image is located in our docker repository of our organization. But the docker is not able to identify the host.

We are able to connect to our repository from docker installed on a linux machine. In that case we have made changes in these 2 files viz.

1.
/etc/systemd/system/docker.service.d/daemon.conf 
here we have added http_proxy and https_proxy.

2.
/etc/docker/daemon.json
here we have mentioned the host name as

{"insecure-registries":["<host-name>"]}

But we are not able to find these files in docker tool-box in windows 7.

Please let us know how to resolve this issue.

We are getting the following error in dockerBuildImage gradle task currently wherein it is not able to download the base image.


:dockerBuildImage FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':dockerBuildImage'.
> Could not build image: Get https:<host-name>/v2/: x509: certificate signed by unknown authority

Please advise.


Solution

  • The following worked for me in docker toolbox

    change the file /var/lib/boot2docker/profile to include following text:

    --insecure-registry=<host1-name>
    export "NO_PROXY=<host-name>"
    export HTTP_PROXY=<value>
    export HTTPS_PROXY=<value>
    

    Then restart the docker-machine to make these changes visible.