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

Windows 10 support still bug #30

Open
yamauchikazu opened this issue Jul 26, 2017 · 2 comments
Open

Windows 10 support still bug #30

yamauchikazu opened this issue Jul 26, 2017 · 2 comments

Comments

@yamauchikazu
Copy link

There are still some bugs in DockerMsftProvider's Windows 10 support. DockerMsftProviderInsider for Insider Container also have same bugs.

"Install-Package -Name Docker -ProviderName DockerMsftProvider" still try to execute "Get-WindowsFeature" and rise error. "Get-WindowsOptionalFeature" code for Windows 10 is not executed becase "Get-wmiobject -class win32_operatingsystem" return not "Microsoft Windows 10" but "Microsoft Windows 10 ".

And "Enable-WindowsOptionalFeature" and "Disable-WindowsOptionalFeature" cmdline need "-Online" option to support Windows 10.

To Fix bugs:
(1) switch(Get-wmiobject -class win32_operatingsystem | select-object -ExpandProperty Caption ){
'Microsoft Windows 10'
-> switch -wildcard (Get-wmiobject -class win32_operatingsystem | select-object -ExpandProperty Caption ){
'Microsoft Windows 10 *'
(2) Enable-WindowsOptionalFeature -FeatureName Containers
-> Enable-WindowsOptionalFeature -FeatureName Containers -Online
(3) Disable-WindowsOptionalFeature -FeatureName Containers
-> Disable-WindowsOptionalFeature -FeatureName Containers -Online

lambdalisue added a commit to lambdalisue/MicrosoftDockerProvider that referenced this issue Aug 30, 2017
Based on OneGet#30. Confirmed with the followings in Windows 10 Pro

Install-Module -ModulePath . -Force -Verbose
Import-PackageProvider -Name DockerMsftProvider -Force -Verbose
Install-Package -Name docker -Provider DockerMsftProvider -Force -Verbose
@brwilkinson
Copy link

Here is some code that I used. . .

    if ($PSVersionTable.PSEdition -EQ 'Desktop')
    {
        # Check on Desktop Edition
        $containerExists = Get-WindowsOptionalFeature -Online -FeatureName containers
        if($containerExists -and ($containerExists.State -EQ 'Enabled'))
        {
            Write-Verbose "Containers feature is already installed. Skipping the install."
            return
        }
        else
        {
            Write-Verbose "Installing Containers..."
            $null = Enable-WindowsOptionalFeature -Online -FeatureName containers
            $script:restartRequired = $true            
        }            
    }
    else
    {
     
        # Check on Server SKU
        $containerExists = Get-WindowsFeature -Name Containers
        if($containerExists -and $containerExists.Installed)
        {
            Write-Verbose "Containers feature is already installed. Skipping the install."
            return
        }
        else
        {
            Write-Verbose "Installing Containers..."
            $null = Install-WindowsFeature containers
            $script:restartRequired = $true            
        }
        
    }

@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.

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

No branches or pull requests

3 participants