title: Can’t install Choclatey into windows docker container
body: <p>Im trying to install Chocolatey into a docker windows container, on a Windows 10 Machine using a Windows Container and not linux containers. Im running the docker build command in the PowerShell console and every time it get to trying to install Chocolatey using the line: <code>Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))</code></p>
  <p>It comes back with:</p>
  <pre><code>Exception calling &quot;DownloadString&quot; with &quot;1&quot; argument(s): &quot;The remote name could not be resolved: 'chocolatey.org'&quot;
   At line:1 char:166
   + ...  -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('ht ...
  +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
  + FullyQualifiedErrorId : WebException
  </code></pre>
  <p>It cant seem to resolve the chocolatey.org part and I'm specifying the network card in my build command:</p>
  <pre><code>docker build --network 21fb9a254e4b --progress=plain --tag jcontent/dockerwinbaseimage .
  </code></pre>
  <p>I have also specified the DNS settings in the Daemon file to look at 8.8.8.8 this is in testing it was not working before this....</p>
  <p>I have attached my Build Script. Any Help would be appreciated.</p>
  <pre><code># escape=`
  FROM microsoft/dotnet-framework:4.7.2-sdk-windowsservercore-ltsc2016
  
  FROM microsoft/windowsservercore:10.0.14393.1358
  
  RUN @powershell [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
  
  ENV chocolateyUseWindowsCompression=false
  RUN @powershell Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
  
  RUN choco config set cachelocation C:\chococache
  
  RUN choco feature enable --name allowGlobalConfirmation 
  
  RUN choco install git; 
  RUN choco install nodejs;
  RUN choco install curl;
  RUN choco install docker;
  RUN choco install terraform;
   
  # choco install visualstudio2015community --confirm --timeout 216000 \
  
  RUN choco install dotnet4.6.1 --confirm --limit-output; 
  
  RUN choco install visualstudio2017enterprise --package-parameters &quot;--passive --locale en-US --includeOptional&quot; --confirm --limit-output --timeout 216000;
  
  RUN choco install visualstudio2017-workload-azure --confirm --limit-output --timeout 21600 --package-parameters &quot;--includeOptional&quot;; 
  RUN choco install visualstudio2017-workload-netcoretools --confirm --limit-output --timeout 21600 --package-parameters &quot;--includeOptional&quot;; 
  RUN choco install visualstudio2017-workload-netweb --confirm --limit-output --timeout 21600 --package-parameters &quot;--includeOptional&quot;; 
       
  
  # Destroy Choclotatey cache
  RUN rmdir /S /Q C:\chococache
  
  # common node tools
  RUN npm install gulp -g &amp;&amp; npm install grunt -g &amp;&amp; npm install -g less &amp;&amp; npm install phantomjs-prebuilt -g;
  
  SHELL [&quot;powershell&quot;, &quot;-Command&quot;, &quot;$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';&quot;]
  
  # Install .NET Core
  ENV DOTNET_VERSION 3.1.7
  ENV DOTNET_DOWNLOAD_URL https://dotnetcli.blob.core.windows.net/dotnet/release/1.1.0/Binaries/$DOTNET_VERSION/dotnet-win-x64.$DOTNET_VERSION.zip
  
  RUN Invoke-WebRequest $Env:DOTNET_DOWNLOAD_URL -OutFile dotnet.zip; \
  RUN Expand-Archive dotnet.zip -DestinationPath $Env:ProgramFiles\dotnet -Force; \
  RUN Remove-Item -Force dotnet.zip
  
  # Install .NET Core
  ENV DOTNET_VERSION 3.1.7
  ENV DOTNET_DOWNLOAD_URL https://dotnetcli.blob.core.windows.net/dotnet/preview/Binaries/$DOTNET_VERSION/dotnet-win-x64.$DOTNET_VERSION.zip
  
  RUN Invoke-WebRequest $Env:DOTNET_DOWNLOAD_URL -OutFile dotnet.zip; \
  RUN Expand-Archive dotnet.zip -DestinationPath $Env:ProgramFiles\dotnet -Force; \
  RUN Remove-Item -Force dotnet.zip
      
  # Install .NET Core SDK
  ENV DOTNET_VERSION 3.1.7
  ENV DOTNET_SDK_DOWNLOAD_URL https://dotnetcli.blob.core.windows.net/dotnet/Sdk/$DOTNET_SDK_VERSION/dotnet-dev-win-x64.$DOTNET_SDK_VERSION.zip
  
  RUN Invoke-WebRequest $Env:DOTNET_SDK_DOWNLOAD_URL -OutFile dotnet.zip; \
  RUN Expand-Archive dotnet.zip -DestinationPath $Env:ProgramFiles\dotnet -Force; \
  RUN Remove-Item -Force dotnet.zip
  
  SHELL [&quot;cmd&quot;, &quot;/S&quot;, &quot;/C&quot;]
  
  RUN setx /M PATH &quot;%PATH%;%ProgramFiles%\dotnet&quot;
  
  # Trigger the population of the local package cache
  ENV NUGET_XMLDOC_MODE skip
  
  RUN mkdir C:\warmup \
  RUN cd C:\warmup \
  RUN dotnet new \
  RUN cd .. \
  RUN rmdir /S /Q C:\warmup 
  
  #Change Working Directory to Install DevOps Tools
  WORKDIR /azp
  #Install DevOps Agents
  COPY start.ps1 .
  #Configure DevOps Agent
  CMD powershell .\start.ps1
  </code></pre>