Windows docker image builds failing due to broken name resolution


I’m not allowed to add links in my post so I’ll put search terms here:

  1. Docker builds from Windows executor failing to retrieve packages from internet
  2. circleci support Windows: The remote name could not be resolved

We’re having build failures which are due to name resolution failures when trying to get resources from the internet.

While diagnosing the issue we found this recent post (1) as well as this day-old support item (2), both suggesting to use the netsh command to set the dns during build.

Sadly that does not help, as the error remains. Even older previously successful builds are now failing if restarted. The status page for CCI doesn’t list any ongoing issues, but something must have changed since even old builds now fail.

If we add a RUN Invoke-WebRequest -UseBasicParsing command to the Dockerfile, even that fails due to name resolution error.

The trimmed down Dockerfile is as follows.

LABEL description="Agent Packaging builder service"

ADD some_files

SHELL ["powershell", "-Command"]
RUN Install-PackageProvider -Name NuGet -MinimumVersion -Force; \
    Install-Module -Name Az -Repository PSGallery -Force

WORKDIR C:/workdir
EXPOSE 80 8080
ENTRYPOINT ["C:\\workdir\\executable.exe"]

Error output as follows.

«» «»
WARNING: Unable to download from URI 
'' to ''.
WARNING: Unable to download the list of available providers. Check your 
internet connection.

Install-PackageProvider : No match was found for the specified search criteria 
for the provider 'NuGet'. The package provider requires 'PackageManagement' 
and 'Provider' tags. Please check if the specified package has the tags.
At line:1 char:149
+ ...  Az module; Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5 ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (Microsoft.Power...PackageProvi 
   der:InstallPackageProvider) [Install-PackageProvider], Exception
    + FullyQualifiedErrorId : NoMatchFoundForProvider,Microsoft.PowerShell.Pac 
Exception calling "ShouldContinue" with "2" argument(s): "Object reference not 
set to an instance of an object."
At C:\Program 
Files\WindowsPowerShell\Modules\PowerShellGet\\PSModule.psm1:7455 char:8
+     if($Force -or $psCmdlet.ShouldContinue($shouldContinueQueryMessag ...
+        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : NullReferenceException

Are there any other ways to get DNS working during docker build?

Thanks in advance