OneGet / MicrosoftDockerProvider

Provider to search, save and install Docker
Other
133 stars 55 forks source link

Remove BITS transfer? #18

Closed StefanScherer closed 6 years ago

StefanScherer commented 7 years ago

After trying hard to use the OneGet provider to install Docker in a Packer build (https://github.com/StefanScherer/packer-windows/pull/17) to create a Win2016+Docker VM I'm still stuck with these error messages.

Packer does WinRM provisioning, but maybe not fully featured as the provider or the BITS transfer needs.

My provision script at the moment looks like this with several checks in it:

$ErrorActionPreference = 'Stop'
$ProgressPreference = 'SilentlyContinue'

Get-PackageSource
Write-Host 'Install-PackageProvider ...'
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
Write-Host 'List Package sources ...'
Get-PackageSource
Write-Host 'Install-Module ...'
Install-Module -Name DockerMsftProvider -Verbose -Force
Write-Host 'Set-PSRepository trusted ...'
Set-PSRepository -InstallationPolicy Trusted -Name PSGallery
Write-Host 'List Package sources ...'
Get-PackageSource -ProviderName DockerMsftProvider
Write-Host 'List Docker versions available'
Find-Package -ProviderName DockerMsftProvider -AllVersions
Write-Host 'Install-Package docker ...'
Install-Package -Name docker -ProviderName DockerMsftProvider -Verbose -Force
Write-Host 'Set-PSRepository untrusted ...'
Set-PSRepository -InstallationPolicy Untrusted -Name PSGallery
Write-Host 'Starting docker service ...'
Start-Service docker

This are some messages I have extracted from the packer output, more details can be found in the PR linked above.

Hash for package 'DockerMsftProvider' does not match hash provided from the server.
Downloading https://dockermsft.blob.core.windows.net/dockercontainer/DockerMsftIndex.json to C:\Users\vagrant\AppData\Local\Temp\DockerMsftProvider\DockerDefault_DockerSearchIndex.json
Cannot find path 'C:\Users\vagrant\AppData\Local\Temp\DockerMsftProvider\DockerDefault_DockerSearchIndex.json' because it does not exist.
Save-HTTPItem: Bits Transfer failed. Job State:  ExitCode = -2147023651

As we now use Invoke-WebRequest both in Dockerfiles for both windowsservercore and nanoserver I kindly ask to remove the BITSTransfer bits from this provider.

I can try to send a PR, but don't know how I can test it.

sulaweyo commented 7 years ago

I just ran into the same problem in my packer build :/

thomaspeitz commented 7 years ago

I am running in the same Issue. Trying to install docker on a windows nano server :(

ghost commented 7 years ago

I've ran into the same problem trying to install docker using Ansible (which uses WinRM) on a Full Windows 2016 server containers installation, I've edited the file DockerMsftProvider.psm1 and replace Save-HttpItem to Invoke-WebRequest and ran just fine. do we have any estimate on how to fix it? @jayshah-msft

davidjahn commented 7 years ago

Hi, we ran into the exact same issue here. It caused us a lot of pain, and we ended up deciding to not use this module. Instead we install Docker within our Packer script directly from the github repo as detailed here:

https://docs.microsoft.com/en-us/virtualization/windowscontainers/manage-docker/configure-docker-daemon

We would like to switch back to this module for our packer builds when the issue is fixed.

ghost commented 7 years ago

@davidjahn another temporary solution was adding Enter-PSSession -ComputerName $env:COMPUTERNAME at the beginning of my script

georgyturevich commented 7 years ago

Hi there,

another temporary solution was adding Enter-PSSession -ComputerName $env:COMPUTERNAME at the beginning of my script

This workaround stopped to help us for some reason. We again se BITS error message.

StefanScherer commented 7 years ago

Seems like #29 has implemented the switch to Invoke-WebRequest. I've sucessfully built VM by using the DockerMsftProviderInsider installing Docker EE 17.03.2 into a non-insider Windows Server 2016 through the WinRM provider of the packer build.

StefanScherer commented 7 years ago

Any chance to update the Insider branch to be merged and make the Invoke-WebRequest the new default for DockerMsftProvider? It works without problems. And in addition it works through an WinRM remote session.

brettjacobson commented 6 years ago

I would like to see the removal of BITS as well, because it causes so much headache with authenticated proxies (meaning, does not work).

sulaweyo commented 6 years ago

Would be great to get the fix from #29 released. This is an issue for a pretty long time and the fix is there for some month as well

carlfischer1 commented 6 years ago

@enderb-ms

enderjbr commented 6 years ago

I am currently working on adding the fix from #29 into the DockerMsftProvider, however, there are some other issues currently blocking me from publishing the version with the fix. I will report back on this issue once that is taken care of.

enderjbr commented 6 years ago

BITS Transfer has now been removed from the provider. If you install DockerMsftProvider from the PowerShell Gallery, you should get version 1.0.0.3 which has this fix. You can also use Update-Module -Name "DockerMsftProvider" to update your provider.