Monthly Archive

Categories

Containers

Cannot verify the file SHA256 when installing package

I’m doing some work requiring containers and decided to use Server 1709 as it has some significant changes when compared to Server 2016.

The documentation - https://docs.microsoft.com/en-us/virtualization/windowscontainers/about/ - just gives options for Windows Server 2016 and Windows Server Insider Preview. As 1709 is the shipping version of the Insider Preview I decided that should work.

 

All went well until it was time to download and install the docker package

Install-Package -Name docker -ProviderName DockerMsftProviderInsider -RequiredVersion 17.06.0-ce -Verbose

 

I saw the index download

VERBOSE: Downloading https://dockermsft.blob.core.windows.net/dockercontainer/DockerMsftIndex.json

then hit a warning

WARNING: Cannot verify the file SHA256. Deleting the file.

The install then terminates with an object not found error

Install-Package : Cannot find path
'C:\Users\Richard\AppData\Local\Temp\2\DockerMsftProviderInsider\Docker-17-06-0-ce.zip' because it does not exist.

 

I tried to use Save-Package but got a similar error. This seems to a be a common issue from the thread here - https://github.com/OneGet/MicrosoftDockerProvider/issues/15

 

I modified the work around from that thread

First: Download the index file

PS>  Start-BitsTransfer -Source https://dockermsft.blob.core.windows.net/dockercontainer/DockerMsftIndex.json -Destination c:\source

 

Convert to PowerShell object

$dv = Get-Content -Path  c:\source\DockerMsftIndex.json | ConvertFrom-Json

 

You can see the versions available

$dv.versions

 

And extract a single version

PS>  $dv.versions.'17.06.0-ce'

date   : 2017-07-10T16:35:52
url    : https://dockermsft.blob.core.windows.net/dockercontainer/docker-17-06-0-ce.zip
size   : 16277800
notes  : This is the latest CE version of docker
sha256 : 3D27360A11A3A627AAC9C6D73EB32D4A9B6DCCA6BCB4B2C7A5FCD9D2E0EC6C82

 

Now you can download the zip file

PS>  Start-BitsTransfer -Source "https://dockermsft.blob.core.windows.net/dockercontainer/docker-17-06-0-ce.zip" -Destination C:\ source\docker.zip

 

Unblock the file just in case

PS>  Unblock-File -Path C:\Source\docker.zip

 

Check the file hash

PS>  $dv.versions.'17.06.0-ce'.sha256
3D27360A11A3A627AAC9C6D73EB32D4A9B6DCCA6BCB4B2C7A5FCD9D2E0EC6C82
PS>  Get-FileHash -Path C:\Source\docker.zip | Format-List

Algorithm : SHA256
Hash      : 3D27360A11A3A627AAC9C6D73EB32D4A9B6DCCA6BCB4B2C7A5FCD9D2E0EC6C82
Path      : C:\Source\docker.zip

They look to be the same but to save wear and tear on my eyeballs

PS>  $dv.versions.'17.06.0-ce'.sha256 -eq (Get-FileHash -Path C:\Source\docker.zip).hash
True

 

Now copy docker.zip to the folder Install-Package was trying to use.

PS>  Copy-Item -Path C:\source\docker.zip -Destination C:\Users\Richard\AppData\Local\Temp\2\DockerMsftprovider\ -Force

 

Notice the 2 in the path. Not sure why that’s there but seems to be necessary.

Move into the folder

PS>  Push-Location -Path C:\Users\Richard\AppData\Local\Temp\2\DockerMsftProvider\

 

The instructions say to rename the zip file but use copy-item instead of rename-item. Its because Install-package will delete the zip file when its completed. This way you have the original available if you need it.

 

You can now install the package.

Install-Package -Name docker -ProviderName DockerMsftProviderInsider -Verbose -RequiredVersion 17.06.0-ce

 

Because the download file exists the save is skipped.  The hash verification works and docker is installed. The installation of docker also enables the containers feature.

 

Restart the VM to finish the installation and start the docker service.

 

This shouldn’t be necessary. Being able to download packages and install them should just work. There’s something wrong in the whole process which needs a MS fix.

Nano server changes

Nano server is the small, really small, footprint install version of Windows Server that was introduced with Server 2016.

It has a limited number of roles available to to install – much like the original version of  Server core.

Recent announcements - https://blogs.technet.microsoft.com/hybridcloud/2017/06/15/delivering-continuous-innovation-with-windows-server/

https://docs.microsoft.com/en-us/windows-server/get-started/nano-in-semi-annual-channel

indicates that Nano server is going to become even smaller (by more than 50%) and dedicated to delivering Containers. The infrastructure related roles will be removed. Nano Server will ONLY be available as a container base OS image

In addition, starting this Autumn, Nano server and  Server Core  will getting 2 feature updates per year.

Windows container providers

Containers are a new feature in Windows 2016. I was preparing for my talk at the WinOps conference next week - http://winops.org/ – and realised I needed the container OS image for nano server

 

I discovered that there are 2 container image providers available through the PowerShell gallery.

 

In TP4 I used the ContainerProvider provider. That still exists BUT only supplies the TP4 images

PS>  ContainerProvider\Find-ContainerImage | ft -a

Name              Version      Source Description
----              -------      ------ -----------
NanoServer        10.0.10586.0        Container OS Image of Windows Server 2016 Technical Preview 4 : Nano Server Installation
WindowsServerCore 10.0.10586.0        Container OS Image of Windows Server 2016 Technical Preview : Windows Server Core Installation

 

If you want the TP5 images you have to use the ContainerImage provider

PS>  ContainerImage\Find-ContainerImage | ft -a

Name              Version         Source                Summary
----              -------         ------                -------
NanoServer        10.0.14300.1010 ContainerImageGallery Container OS Image of Windows Server 2016 Technical Preview 5 : Nano Server I...
WindowsServerCore 10.0.14300.1000 ContainerImageGallery Container OS Image of Windows Server 2016 Technical Preview 5 : Windows Serve...

 

This isn’t very satisfactory and will cause lots of confusion in the long term. I just hope we’re not getting a new provider with every new version of Windows 2016