Open sidviscious opened 7 years ago
Can you please run the command with -Verbose and provide the output?
install-package -name docker -providername DockerMsftProvider -Verbose
Thanks, Jay!
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
- CategoryInfo : ObjectNotFound: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Ex
ception
- FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage
Can you please provide output of: find-package -name docker -providername DockerMsftProvider -Verbose
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
- CategoryInfo : ObjectNotFound: (Microsoft.Power...ets.FindPackage:FindPackage) [Find-Package], Exception
- FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.FindPackage
@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?
I'm also having this problem - see also: Microsoft/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/
@jayshah-msft I was behind a proxy. Tried it from a different network and it worked Thank you.
@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...
@dhirschfeld reopened it.
Thx!
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
@dhirschfeld, We have put this on our backlog for January 2017. We will keep this thread posted.
Thanks for your feedback.
Cheers, Jay!
@jayshah-msft - any update on this - has the timeline slipped?
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}
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).
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'.".
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.
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.
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
https://stackoverflow.com/a/64654070/14413665 worked for me
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.
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: https://github.com/OneGet/MicrosoftDockerProvider/blob/68a31d2485a2758273c4f20402fb61afec62dd6e/DockerMsftProvider.psm1#L1167
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?
For anybody that runs into this in the future, the MicrosoftDockerProvider is now deprecated and doesn't work. https://github.com/OneGet/MicrosoftDockerProvider
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