Scyla101
Scyla101

Reputation: 242

Docker Terminal connection refused

I've also asked this question over at the Docker boards but got no response there. If someone knows a solution for the issue it might be helpful to post the answer in the Docker boards as well. Here is a link to the question.

My task is to create a Docker image from a Tomcat web app that I’ve developed. I’ve set up Docker on my Windows 7 machine and I think I got it almost working. After several configuration attempts, I managed to get a connection to the docker repository. To get that working I had add the proxy server which I extracted from the PAC file (more on that later) to the config.json file:

enter image description here

My understanding is that for creating an image from my web app I need to use the Docker terminal to access the default VM hosts file system to get the packaged war file and the Dockerfile to create an image. For that the terminal sends an HTTP Post request to the Docker default VM that then creates the Docker image.

Here is where I get an error message. Apparently when firing the HTTP request to the IP of the default VM (168.192.99.100) the Docker terminal sends it in a way that routes the request over the corporate proxy resulting in an error:

enter image description here

I thought I would have this issue covered since I added the default VMs IP address to the NP_PROXY variable in the config.json file. This doesn’t seem to have the desired effect. If I use curl to do an HTTP Get to the default VM I get the same connection error that I get when I browse the Internet and encounter a site that is blocked by the firewall.

As a related note, I also have the HTTP_PROXY, HTTPS_PROXY and NO_PROXY environment variables set directly in Windows.

I’ve talked to one of our network guys who told me that the NO_PROXY variable has no influence on the HTTP requests because the corporate network uses a PAC file for the proxy configuration. Apparently the Docker terminal uses the proxy configuration from the PAC file to route its requests thus the NO_PROXY settings have not effect on the requests.

His advise would be to find a way to start the Docker terminal without the proxy configuration. I’ve looked at the start.sh script that is responsible for starting the Docker terminal and tried to determine how to achieve this but had no success.

Has anyone encountered this situation before and knows hot to resolve the issue?

Any help is appreciated.

Upvotes: 1

Views: 527

Answers (1)

Scyla101
Scyla101

Reputation: 242

After tinkering around with some settings I found a workaround for this problem that might be helpful to other.

Apparently the Docker quickstart terminal ignores the NO_PROXY environment variable. As soon as I removed the HTTP_PROXY and HTTPS_PROXY environment variables the terminal worked as expected.

Upvotes: 1

Related Questions