Trying to install Docker in process isolation on Windows Server 2019 and following these steps. (I can't use Hyper-V on this server) when running PowerShell in admin mode.
I however get the error
Get-PackageProvider : A parameter cannot be found that matches parameter name 'ListAvailableget-packagesource'
I also tried Install-Package -Name docker -ProviderName DockerMsftProvider
I then get:
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], E
xception
+ FullyQualifiedErrorId : UnknownProviders,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage
Install-Package : Unable to find package providers (DockerMsftProvider).
At line:3 char:1
+ Install-Package -Name docker -ProviderName DockerMsftProvider
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], E
xception
+ FullyQualifiedErrorId : UnknownProviders,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage
UPDATE 1
I had to set the PowerShell execution policy to unrestricted like so (I'll set it back to Restricted Set-ExecutionPolicy -ExecutionPolicy Restricted
after all this):
Set-ExecutionPolicy -ExecutionPolicy Unrestricted
I also had to temporarily disable some antivirus/malware protection from Windows Defender. For me antimalware was already disabled so I had to also disable real-time virus protection.
I then could run
Install-Module -Name DockerMsftProvider -Repository PSGallery -Force
Now via Get-PackageProvider -ListAvailable
I see that DockerMsftProvider
is installed.
Name Version DynamicOptions
---- ------- --------------
DockerMsftProvider 1.0.0.8 Update
msi 3.0.0.0 AdditionalArguments
msu 3.0.0.0
NuGet 2.8.5.208 Destination, ExcludeVersion, Scope, SkipDependencies, Headers, FilterOnTag...
PowerShellGet 1.0.0.1 PackageManagementProvider, Type, Scope, AllowClobber, SkipPublisherCheck, ...
Programs 3.0.0.0 IncludeWindowsInstaller, IncludeSystemComponent
I ran Install-Package -Name docker -ProviderName DockerMsftProvider
and entered Y
.
I then run Get-Package -Name Docker -ProviderName DockerMsftProvider
and get:
Name Version Source ProviderName
---- ------- ------ ------------
docker 20.10.0 DockerDefault DockerMsftProvider
When I run Install-Package -Name docker -ProviderName DockerMsftProvider
I get no feedback via PowerShell, no errors, so I think it's good.
However, when I checked here and ran docker run --isolation=process mcr.microsoft.com/windows/nanoserver:1809 cmd.exe /c ping 127.0.0.1 -t
I get the error
docker : The term 'docker' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ docker run --isolation=process mcr.microsoft.com/windows/nanoserver:1 ...
+ ~~~~~~
+ CategoryInfo : ObjectNotFound: (docker:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
In the past I had tried to install Docker Desktop, which I then uninstalled since my VPS does not support Hyper-V.
I'm not sure if this is still from that install or new, but I added path C:\Program Files\Docker
to my environment PATH
variable.
Still I get the same error
The term 'docker' is not recognized as the name of a cmdlet, function, script file, or operable program.
UPDATE 2
Based on @Peter Wishart's answer I checked my PATH
system variables, but Docker can be seen there (see screenshot below) and as Peter also mentioned, since I can run docker --version
via the command prompt (not PowerShell) the install did complete successfully.
UPDATE 3
I checked ($env:path).Split(";")
in PowerShell and the Docker path is there:
How can I install Docker?