Quantcast
Channel: Active questions tagged dockerfile - DevOps Stack Exchange
Viewing all articles
Browse latest Browse all 136

PROXY is not working inside windows container

$
0
0

I'm using windows containers in windows 10. I've set proxy variables(HTTP_PROXY,HTTPS_PROXY) in environmental variable setup and using VPN. I also configured resources -> Proxies.

I was trying to build docker image with following Dockerfile content.

FROM mcr.microsoft.com/windows/servercore:ltsc2019SHELL ["cmd", "/S", "/C"]RUN mkdir c:\temp \&& curl -SL --output c:\temp\vs_buildtools.exe https://aka.ms/vs/16/release/vs_buildtools.exe

When this docker image build command is executed it shows following error.

Step 5/5 : RUN mkdir c:\temp     && curl -SL --output c:\temp\vs_buildtools.exe https://aka.ms/vs/16/release/vs_buildtools.exe ---> Running in 0c134b2d004a  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current                                 Dload  Upload   Total   Spent    Left  Speed  0     0    0     0    0     0      0      0 --:--:--  0:00:12 --:--:--     0curl: (6) Could not resolve host: aka.msThe command 'cmd /S /C mkdir c:\temp     && curl -SL --output c:\temp\vs_buildtools.exe https://aka.ms/vs/16/release/vs_buildtools.exe' returned a non-zero code: 6

I tried to build this with build arguments, and added dns: 8.8.8.8 in docker deamon config file

docker build --build-arg HTTP_PROXY --build-arg HTTPS_PROXY --tag=tswin .

But above mentioned error is not solved.

When the same curl command is executed in Windows's CMD it is not throwing any error

C:\Users\mshanm6x>curl -SL --output c:\temp\vs_buildtools.exe https://aka.ms/vs/16/release/vs_buildtools.exe  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current                                 Dload  Upload   Total   Spent    Left  Speed  0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0100 1432k  100 1432k    0     0   238k      0  0:00:06  0:00:06 --:--:--  332k

Also the same Dockerfile was able to built by without HTTP_PROXY, HTTPS_PROXY env variables and VPN off.

What is the real issue. Why it is not working inside of container with proxy configuration.


Viewing all articles
Browse latest Browse all 136

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>