Unable to Install Docker using PowerShell 7 (P.3)
See original GitHub issueTrying to install Docker inside WIndows Server 2019 fails. It does not appear to be possible to install the latest version of Docker using PWSH 7 (P3).
Steps to reproduce
Install-Module -Name WindowsCompatibility -Force
$IHT1 = @{
Name ='DockerMSFTProvider'
Repository = 'PSGallery'
Force = $True
}
Install-Module @IHT1
$IHT2 = @{
Name = 'Docker'
ProviderName = 'DockerMSFTProvider'
Force = $True
}
Install-Package @IHT2
Expected behavior
This should have installed Docker - and it works in PWSH 5.x
Actual behaviour
PS C:\Foo> $IHT2 = @{
Name = 'Docker'
ProviderName = 'DockerMSFTProvider'
Force = $True
}
PS C:\Foo> Install-Package @IHT2
Install-Package : The term 'Get-WindowsFeature' 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:6 char:1
+ Install-Package @IHT2
+ ~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (Microsoft.PowerShel…lets.InstallPackage:InstallPackage) [Install-Package], Exception
+ FullyQualifiedErrorId : FailedToDownload,Install-Package,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage
This is kind of weird since Get-WindowsFeature is available. I’ve loaded the module using Import-WinModule.
Environment data
> docker info
docker : The term 'docker' is not recognized as the name of a cmdlet, function, script file, or operable program.
Of course, since docker did not get installed, the above result is to be expected.
PS C:\Foo> $PSVersionTable
Name Value
---- -----
PSVersion 7.0.0-preview.3
PSEdition Core
GitCommitId 7.0.0-preview.3
OS Microsoft Windows 10.0.17763
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0, 5.0, 5.1.10032.0, 6.0.0, 6.1.0, 6.2.0, 7.0.0-preview.3}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (7 by maintainers)
Top Results From Across the Web
Error trying to install Docker in Windows Server 2016 with ...
I tried all above solution but I could not get it work until I run this command set-executionpolicy unrestricted.
Read more >Troubleshoot Docker Engine installation
Unable to connect to the Docker daemon This error may indicate: The Docker daemon isn't running on your system. Start the daemon and...
Read more >Not able to install feature Containers on Windows Server ...
The operation completed successfully. 3°) dism /online /cleanup-image /scanhealth Result: Deployment Image Servicing and Management tool Version ...
Read more >Install Docker in WSL 2 without Docker Desktop
Step 1: Uninstall Docker Desktop · Step 2: Install Docker / Docker Compose v2 in WSL 2 · Step 3: Ensure the Docker...
Read more >Installing Docker Desktop for Windows and WSL 2
In this post I show how to install Docker Desktop for Windows, including WSL 2, and explore the initial experience of running a...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Using RC1, this now works OK:
In trying to install Docker, I explicitly use Import-WinModule to “import” the Server Manager module, thus Get-WindowsFeature should work - but it doesn’t. I am not a great debugger so can not quite work out why this is happening.