question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to Install Docker using PowerShell 7 (P.3)

See original GitHub issue

Trying 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:closed
  • Created 4 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
doctordnscommented, Jan 11, 2020

Using RC1, this now works OK:

S C:\Foo> $IHT1 = @{
>>   Name       ='DockerMSFTProvider'
>>   Repository = 'PSGallery'
>>   Force      = $True
>> }
PS C:\Foo> Install-Module @IHT1
PS C:\Foo> $IHT2 = @{
>>   Name         = 'Docker'
>>   ProviderName = 'DockerMSFTProvider'
>>   Force        = $True
>> }
PS C:\Foo> Install-Package @IHT2
WARNING: A restart is required to enable the containers feature. Please restart your machine.

Name          Version          Source           Summary
----          -------          ------           -------
Docker        19.03.5          DockerDefault    Contains Docker EE for use with Windows Server.
0reactions
doctordnscommented, Oct 12, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found