Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error installing docker on Windows Server 2016 behind proxy #14

Open
sidviscious opened this issue Nov 2, 2016 · 23 comments
Open

Error installing docker on Windows Server 2016 behind proxy #14

sidviscious opened this issue Nov 2, 2016 · 23 comments
Assignees
Milestone

Comments

@sidviscious
Copy link

Trying to install docker on windows server 2016 in a VM. Fails with the below error.

PS C:\Windows\system32> install-package -name docker -providername DockerMsftProvider -Force
WARNING: Cannot find path 'C:\Users\TESUSR~1\AppData\Local\Temp\DockerMsftProvider\DockerDefault_DockerSearchIndex.json' because it does not exist.
WARNING: Cannot bind argument to parameter 'downloadURL' because it is an empty string.
WARNING: The property 'AbsoluteUri' cannot be found on this object. Verify that the property exists.
WARNING: The property 'RequestMessage' cannot be found on this object. Verify that the property exists.
install-package : No match was found for the specified search criteria and package name 'docker'. Try Get-PackageSource to see all available registered package sources.
At line:1 char:1

  • install-package -name docker -providername DockerMsftProvider -Force
  •   + CategoryInfo          : ObjectNotFound: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Exception
      + FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage
    
@jayshah-msft
Copy link
Contributor

Can you please run the command with -Verbose and provide the output?

install-package -name docker -providername DockerMsftProvider -Verbose

Thanks,
Jay!

@sidviscious
Copy link
Author

sidviscious commented Nov 2, 2016

Hi Jay, here's the output with verbose option:-
PS C:\Windows\system32> install-package -name docker -providername DockerMsftProvider -Force -verbose
VERBOSE: Importing package provider 'DockerMsftProvider'.
VERBOSE: Using the provider 'DockerMsftProvider' for searching packages.
WARNING: Cannot find path
'C:\Users\ADMINI~1\AppData\Local\Temp\DockerMsftProvider\DockerDefault_DockerSearchIndex.json' because it does not
exist.
WARNING: Cannot bind argument to parameter 'downloadURL' because it is an empty string.
WARNING: The property 'AbsoluteUri' cannot be found on this object. Verify that the property exists.
WARNING: The property 'RequestMessage' cannot be found on this object. Verify that the property exists.
install-package : No match was found for the specified search criteria and package name 'docker'. Try
Get-PackageSource to see all available registered package sources.
At line:1 char:1

  • install-package -name docker -providername DockerMsftProvider -Force ...
  • - CategoryInfo          : ObjectNotFound: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Ex
      ception
    - FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage
    

@jayshah-msft
Copy link
Contributor

Can you please provide output of:
find-package -name docker -providername DockerMsftProvider -Verbose

@sidviscious
Copy link
Author

PS C:\Windows\system32> find-package -name docker -providername DockerMsftProvider -Verbose
VERBOSE: Importing package provider 'DockerMsftProvider'.
VERBOSE: Using the provider 'DockerMsftProvider' for searching packages.
WARNING: Cannot find path 'C:\Users\ADMINI~1\AppData\Local\Temp\DockerMsftProvider\DockerDefault_DockerSearchIndex.json' because it does not exist.
WARNING: Cannot bind argument to parameter 'downloadURL' because it is an empty string.
WARNING: The property 'AbsoluteUri' cannot be found on this object. Verify that the property exists.
WARNING: The property 'RequestMessage' cannot be found on this object. Verify that the property exists.
find-package : No match was found for the specified search criteria and package name 'docker'. Try Get-PackageSource to see all available registered package sources.
At line:1 char:1

  • find-package -name docker -providername DockerMsftProvider -Verbose
  • - CategoryInfo          : ObjectNotFound: (Microsoft.Power...ets.FindPackage:FindPackage) [Find-Package], Exception
    - FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.FindPackage
    

@jayshah-msft
Copy link
Contributor

@sidviscious,
Seems like you are not connected to the internet. Can you please confirm you have internet connection on the machine you are facing your error?

@dhirschfeld
Copy link

dhirschfeld commented Nov 3, 2016

I'm also having this problem - see also: MicrosoftDocs/Virtualization-Documentation#434

In my case, I'm behind a proxy.

Changing the below command:

Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force

to

Install-PackageProvider -Proxy http://MYPROXY:80 -ProxyCredential (Get-Credential) -Name NuGet -MinimumVersion 2.8.5.201 -Force 

worked for me, but I can't see any way to pass proxy credentials for the later Install-Package command to pass through?

Ref: https://blog.docker.com/2016/09/build-your-first-docker-windows-server-container/

@sidviscious
Copy link
Author

@jayshah-msft I was behind a proxy. Tried it from a different network and it worked Thank you.

@dhirschfeld
Copy link

@sidviscious - could you reopen this please? I can't just try another network so I need this to work from behind a corporate proxy.

Until it does, I'm stuck AFAICS...

@sidviscious sidviscious reopened this Nov 3, 2016
@sidviscious
Copy link
Author

@dhirschfeld reopened it.

@dhirschfeld
Copy link

Thx!

@sidviscious sidviscious changed the title Error installing docker on Windows Server 2016 Error installing docker on Windows Server 2016 behind proxy Nov 3, 2016
@dhirschfeld
Copy link

In case it helps anyone else you can manually download and install following the instructions at:

https://msdn.microsoft.com/en-au/virtualization/windowscontainers/docker/configure_docker_daemon

@jayshah-msft jayshah-msft added this to the 1701 milestone Nov 16, 2016
@jayshah-msft jayshah-msft self-assigned this Nov 16, 2016
@jayshah-msft
Copy link
Contributor

@dhirschfeld,
We have put this on our backlog for January 2017. We will keep this thread posted.

Thanks for your feedback.

Cheers,
Jay!

@dhirschfeld
Copy link

@jayshah-msft - any update on this - has the timeline slipped?

@kethahel99
Copy link

Use -Proxy flag with your proxy. It works fine

Install-Module DockerProvider -Force -Proxy {http://yourproxyserver:port}
and
Install-Package Docker -ProviderName DockerProvider -Force -Proxy {http://yourproxyserver:port}

@brettjacobson
Copy link

Install-Package Docker does not work when the proxy requires authentication credentials (@kethahel99 says it works with a non-authenticated proxy though).
However, https://github.com/OneGet/MicrosoftDockerProvider#not-supported-scenarios says that it's using BITS under the covers which doesn't support proxy (BITS does support a proxy, but NOT authenticated proxies, sigh).

@robbmanes
Copy link

I know this looks like a zombie thread right now, but for anyone on Windows 10 who googled and ended up here because of something that looks like this:

PS C:\Windows\system32> Install-Package -Name docker -ProviderName DockerMsftProvider                                                                         Install-Package : Unable to find package providers (DockerMsftProvider).
At line:1 char:1
+ Install-Package -Name docker -ProviderName DockerMsftProvider
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Exception
    + FullyQualifiedErrorId : UnknownProviders,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage

Make sure you check your execution policy as well. Eventually after trying enough things, I listed available package providers and came across this error:

PS C:\Windows\system32> Get-PackageProvider -ListAvailable
WARNING: File C:\Program Files\WindowsPowerShell\Modules\DockerMsftProvider\1.0.0.8\DockerMsftProvider.psm1 cannot be loaded because running scripts is
disabled on this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
WARNING: File C:\Program Files\WindowsPowerShell\Modules\DockerProvider\0.0.0.3\DockerProvider.psm1 cannot be loaded because running scripts is disabled on
this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.

Name                     Version          DynamicOptions
----                     -------          --------------
msi                      3.0.0.0          AdditionalArguments
msu                      3.0.0.0
NuGet                    2.8.5.208        Destination, ExcludeVersion, Scope, SkipDependencies, Headers, FilterOnTag, Contains, AllowPrereleaseVersions, C...
PowerShellGet            1.0.0.1          PackageManagementProvider, Type, Scope, AllowClobber, SkipPublisherCheck, InstallUpdate, NoPathUpdate, Filter, T...
Programs                 3.0.0.0          IncludeWindowsInstaller, IncludeSystemComponent

And from there, I was able to read about the default execution policy, which is Restricted on Windows 10. Changing it resolved the problem for me:

PS C:\Windows\system32> Get-ExecutionPolicy
Restricted
PS C:\Windows\system32> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned

And then it installed with zero problems.

PS C:\Windows\system32>  Install-Package -Name docker -ProviderName DockerMsftProvider -Verbose
VERBOSE: Importing package provider 'DockerMsftProvider'.
VERBOSE: Using the provider 'DockerMsftProvider' for searching packages.
VERBOSE: Download size: 0.02MB
VERBOSE: Free space on the drive: 425448.88MB
VERBOSE: Downloading https://dockermsft.blob.core.windows.net/dockercontainer/DockerMsftIndex.json to
C:\Users\robbm\AppData\Local\Temp\DockerMsftProvider\DockerDefault_DockerSearchIndex.json
VERBOSE: About to download
VERBOSE: Finished downloading
VERBOSE: Downloaded in 0 hours, 0 minutes, 0 seconds.
VERBOSE: Performing the operation "Install Package" on target "Package 'Docker' version '19.03.3' from 'DockerDefault'.".

@mdrichardson
Copy link

In case anybody else comes across this, I ran into the same error with Windows Server 2016 installed in a Hyper-V session (which I guess counts as a proxy). The fix was to install Powershell Core v7 and it worked just fine.

@michaelsync
Copy link

I tried with Powershell 5.1 and Powershell Core v7 on new Windows Server 2016 (Ver 1607 Build: 14393.3443) but still getting the same error.

@ramonsmits
Copy link

Had similar issues, solution was [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Install-PackageProvider -Name NuGet
Install-Module DockerMsftProvider -Force
Install-Package Docker -ProviderName DockerMsftProvider -Force

Source: https://stackoverflow.com/questions/45638302/error-trying-to-install-docker-in-windows-server-2016-with-install-module

@pavan589
Copy link

https://stackoverflow.com/a/64654070/14413665 worked for me

@slonopotamus
Copy link

You might want to take a look at Stevedore project as a way to install modern Docker for Windows containers on both Windows Server/Client.

@Geogboe
Copy link

Geogboe commented Mar 8, 2022

I had to set a system proxy in the new Windows server settings panel to get this to work with a proxy. The -proxy parameters appears to be getting ignored during the Find-Package step.

Looking at the source code for DockerMsftProvider.psm1 it appears that the provider uses the function Get-HttpResponse to resolve https://go.microsoft.com/fwlink/?LinkID=825636&clcid=0x409 to https://dockermsft.azureedge.net/dockercontainer/DockerMsftIndex.json and this function doesn't take into account a -proxy parameter being passed:

function Get-HttpResponse

The function utilizes HttpClient though which does seem to use the system proxy, if it's set. Seems like a simple solution would be to update this function to not ignore -proxy, or to just document that you need to set the system proxy. Is this a bug or by design?

@d-duer
Copy link

d-duer commented Jun 14, 2023

For anybody that runs into this in the future, the MicrosoftDockerProvider is now deprecated and doesn't work. https://github.com/OneGet/MicrosoftDockerProvider

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests