HardikT
HardikT

Reputation: 751

docker pull under corporate network - windows

Now questions surrounding this topic might be found in abundance here; but when I was facing this issue I surfed throughout the internet, pulling out my hairs, but wasn't able to find a proper solution.

Now, the situation -

I am working on creating docker containers by pulling images from the docker registry. I am working on Windows. I am under the corporate network where Cyberroam is used. When pulling any image I was getting error of

TLS Handshake timeout

When getting out of the corporate network, this issue is getting resolved and I am not getting any errors - all image pulls are working properly.

Not sure if it's a proxy issue or not. But I need it to work under corporate network as the other option for internet is limited.

Upvotes: 1

Views: 597

Answers (1)

HardikT
HardikT

Reputation: 751

I surfed through the internet many times but with failure all the time.

I tried multiple things, like -

  • Applying HTTP_PROXY, HTTPS_PROXY and NO_PROXY environment variables at multiple locations (seperate options) like in the docker-machine config file, in the command prompt when the virtual machine is up, in the docker daemon settings under option Proxies.

But my error wasn't getting solved.

So, with less hope I started from beginning and did this -

Firstly I created a new Virtual Switch in Hyper-V Manager. I selected internal option from the given.

Then, going to Network Settings > Change Adapter Settings I opened the properties of the wireless adapter that I used (corporate network).

Under Sharing tab I selected the first option - Allow other network users to connect through this computer's internet connection.

From the dropdown select the virtualswitch that you created in the first step.

Restart docker and in cmd restart the virtual machine - docker-machine restart [machinename]. You might be asked to regenerate the certificates for the virtual machine. Run the commands shown in cmd and you will be good to go.

Now try to pull any image and the error would be solved.


Now I know there would be multiple links in the internet for this solution with most of them suggesting to set environment variables (which, btw, might be the solution for many. Unfortunately wasn't for me).

According to my understanding -

The docker tries to connect to the outer world for pulling an image. Now, previously it wasn't able to pull because, if you think in a way, the docker is inside an environment, which needs to communicate with my laptop in order to access the outer net.

Now, without making any connection between the docker and the laptop internet, it would be able to access the internet. Consider it as a broken link, if you may. Previously I had created a bridge between the virtual switch and the wireless adapter but it wasn't helping. On following the above steps, I was able to do successfully.

Below is an image showing what I understood.

docker connectivity

Now this was the solution that I got, able sooo many days; that I had to write this QA with the hope of someone else getting stuck at this point might get some help.

Hope it helps.

Upvotes: 1

Related Questions