Mathiyazhagan
Mathiyazhagan

Reputation: 1429

Docker build failed for InvokeWebrequest

I have a docker file to install sql server on windows server core. the below command fails with error

Docker Command

RUN Invoke-WebRequest -Uri $env:box -OutFile SQL.box ;      Invoke-WebRequest -Uri $env:exe -OutFile SQL.exe ;         Start-Process -Wait -FilePath .\SQL.exe -ArgumentList /qs, /x:setup ;         .\setup\setup.exe /q /ACTION=Install /INSTANCENAME=MSSQLSERVER /FEATURES=SQLEngine /UPDATEENABLED=0 /SQLSVCACCOUNT='NT AUTHORITY\System' /SQLSYSADMINACCOUNTS='BUILTIN\ADMINISTRATORS' /TCPENABLED=1 /NPENABLED=0 /IACCEPTSQLSERVERLICENSETERMS ;         Remove-Item -Recurse -Force SQL.exe, SQL.box, setup

Error Message

Invoke-WebRequest : The remote name could not be resolved: 'go.microsoft.com' At line:1 char:76 + ... lyContinue'; Invoke-WebRequest -Uri $env:box -OutFile SQL.box ; Invok ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:Htt pWebRequest) [Invoke-WebRequest], WebException + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShe
ll.Commands.InvokeWebRequestCommand

The same docker file worked yesterday, but today it is failing continuously. Anyone has faced similar issue?

Upvotes: 4

Views: 2408

Answers (2)

Zach Nudelman
Zach Nudelman

Reputation: 13

I'm not sure what the problem is exactly but this worked for me:

Check out this script: https://github.com/MicrosoftDocs/Virtualization-Documentation/tree/master/windows-server-container-tools/CleanupContainerHostNetworking

Save it somewhere (or clone the whole repo). Run the cleanup command that suits your needs and restart your machine.

Upvotes: 0

Max Manets
Max Manets

Reputation: 31

Configure the Docker daemon by typing a json Docker daemon configuration file. { .... "dns": ["1.1.1.1","8.8.8.8", "8.8.4.4"], ... }

Upvotes: 3

Related Questions