OneGet / NanoServerPackage

21 stars 11 forks source link

Fails when used within Nano ContainerImage #4

Open bgelens opened 8 years ago

bgelens commented 8 years ago

When I want to use the NanoServerPackage provider inside of a running Nano Container it fails. See image for details

untitled

quoctruong commented 8 years ago

Hi @bgelens, the NanoServerPackage only works for TP5 version of NanoServer (10.0.14300.1000). Can you try with any version that is greater than 10.0.14300.1000?

shirhatti commented 8 years ago

I am still able to repro this issue in TP5

DockerFile contents

FROM nanoserver:10.0.14300.1016

RUN powershell Install-PackageProvider -Force NanoServerPackage
RUN powershell Import-PackageProvider NanoServerPackage
RUN powershell Install-NanoServerPackage -Name Microsoft-NanoServer-IIS-Package -Culture "en-US"

Console out from docker build

Sending build context to Docker daemon 67.41 MB
Step 1 : FROM nanoserver:10.0.14300.1016
 ---> 3f5112ddd185
Step 2 : RUN powershell Install-PackageProvider -Force NanoServerPackage
 ---> Running in 7c6481db7329

Name                           Version          Source           Summary
----                           -------          ------           -------
NanoServerPackage              0.1.1.0          PSGallery        A PackageMa...

 ---> 7857279f9d54
Removing intermediate container 7c6481db7329
Step 3 : RUN powershell Import-PackageProvider NanoServerPackage
 ---> Running in 75d36c443627

Name                     Version          DynamicOptions
----                     -------          --------------
NanoServerPackage        0.1.1.0          NoRestart, ToVhd, FromVhd, Display...

 ---> 9916198cce2f
Removing intermediate container 75d36c443627
Step 4 : RUN powershell Install-NanoServerPackage -Name Microsoft-NanoServer-IIS-Package -Culture "en-US"
 ---> Running in 4dbbfc5da79b
DownloadFile : Save-HTTPItem: Bits Transfer failed. Job State:  ExitCode = 255
At C:\Program Files\WindowsPowerShell\Modules\NanoServerPackage\0.1.1.0\NanoSer
verPackage.psm1:1294 char:9
+         DownloadFile -downloadURL $fullUrl `
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (https://nanoser...ServerIndex
   .txt:String) [DownloadFile], RuntimeException
    + FullyQualifiedErrorId : FailedToDownload,DownloadFile

The command 'cmd /S /C powershell Install-NanoServerPackage -Name Microsoft-NanoServer-IIS-Package -Culture "en-US"' returned a non-zero code: 1

cc @PatrickLang

bgelens commented 8 years ago

AFAIK this is the latest Container OS Image available to me. I'm running my Nano Containers on Win10 Insider Preview and got the image by following: https://msdn.microsoft.com/en-us/virtualization/windowscontainers/quick_start/quick_start_windows_10

Start-BitsTransfer https://aka.ms/tp5/6b/docker/nanoserver -Destination nanoserver.tar.gz
docker load -i nanoserver.tar.gz

I don't know if there is a newer one as the ContainerImages PackageProvider doesn't work anymore as it relies on Install-ContainerOSImage (which has been removed from the Containers PowerShell module). https://github.com/Microsoft/Docker-PowerShell/issues/92

Update: The metadata of the image shows it's version 10.0.14300.1030

marrobi commented 8 years ago

Same issue here, nanoserver image 10.0.14300.1016. Running Install-PackageProvider NanoServerPackage -Verbose.

VERBOSE: Using the provider 'Bootstrap' for searching packages.
VERBOSE: Finding the package 'Bootstrap::FindPackage' 
'NanoServerPackage','','','''.
VERBOSE: Using the provider 'PowerShellGet' for searching packages.
VERBOSE: The -Repository parameter was not specified.  PowerShellGet will use 
all of the registered repositories.
VERBOSE: Getting the provider object for the PackageManagement Provider 
'NuGet'.
VERBOSE: No match was found for the specified search criteria and provider name
 'NuGet'. Try 'Get-PackageProvider -ListAvailable' to see if the provider 
exists on the system.
VERBOSE: Finding the package 'Bootstrap::FindPackage' 'NuGet','','0.0.0.1','''.
VERBOSE: Installing the package 
'https://oneget.org/nugetv2-coreclr-2.8.5.206.package.swidtag'.
VERBOSE: Installed the package 'nuget' to 'C:\Program 
Files\PackageManagement\ProviderAssemblies\nuget\2.8.5.206\Microsoft.PackageMan
agement.NuGetProvider.dll'.
VERBOSE: Skipping previously processed assembly: C:\Program 
Files\WindowsPowerShell\Modules\PackageManagement\1.0.0.1\Microsoft.PackageMana
gement.MetaProvider.PowerShell.dll.
VERBOSE: Skipping previously processed assembly: C:\Program 
Files\WindowsPowerShell\Modules\PackageManagement\1.0.0.1\Microsoft.PackageMana
gement.CoreProviders.dll.
VERBOSE: Skipping previously processed assembly: C:\Program 
Files\WindowsPowerShell\Modules\PackageManagement\1.0.0.1\Microsoft.PackageMana
gement.ArchiverProviders.dll.
WARNING: The specified PackageManagement provider 'NuGet' is not available.
.\docker : Install-PackageProvider : No match was found for the specified search criteria 
    + CategoryInfo          : NotSpecified: (Install-Package...earch criteria :String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

for the provider 'NanoServerPackage'. The package provider requires 
'PackageManagement' and 'Provider' tags. Please check if the specified package 
has the tags.
At line:1 char:1
+ Install-PackageProvider NanoServerPackage -Verbose -Force
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (Microsoft.Power...PackageProvi 
   der:InstallPackageProvider) [Install-PackageProvider], Exception
    + FullyQualifiedErrorId : NoMatchFoundForProvider,Microsoft.PowerShell.Pac 
   kageManagement.Cmdlets.InstallPackageProvider

Update: Just a note to say this is running within a Nano server VM, rather than on Windows 10.

quoctruong commented 8 years ago

Hi @marrobi, can I ask what do you get when running "Get-PackageProvider -Verbose -Debug"?

marrobi commented 8 years ago

After our S4B session, just to confirm:

Host is Nano Server TP5, Container Image is 10.0.14300.1030 .

From Ben's post above he has the same issue on Windows 10 as the host. Same container image version.

quoctruong commented 8 years ago

We are working to identify a fix for this issue.

bmmathe commented 8 years ago

Any updates? The Azure Nano VM is having this same issue (TP5).

xumins commented 8 years ago

running 'install-nanoserverpackage' via docker.exe is not a supported scenario for Win10 desktop or Windows Server 2016. But with your request, we have added this scenario for post Win10 release feature request, with caveat that it may not be able to patch to Win10 machines.

PatrickLang commented 8 years ago

cc @mylesbkeating1993 since we were discussing this earlier

In the meantime, do you think an approach like this would work?

(untested, just proof of concept) On the host:

Install-PackageProvider -Force NanoServerPackage
Import-PackageProvider NanoServerPackage
Save-NanoServerPackage -Name Microsoft-NanoServer-IIS-Package -Culture "en-US"

Dockerfile:

FROM microsoft/nanoserver
ADD Microsoft-NanoServer-IIS-Package_en-us.cab c:/sources
RUN dism.exe /online /add-package /packagepath:c:\sources\Microsoft-NanoServer-IIS-Package_en-us.cab
artisticcheese commented 7 years ago

Any progress on this issue? I was planning to use Nanoserver docker image for IIS but creating docker file is almost impossible since I use DSC to prep the image and can not load DSC package into container.

mikael0hlsson commented 7 years ago

also wondering about if there are any progress.

ghost commented 7 years ago

@PatrickLang :)

PatrickLang commented 7 years ago

Nothing we can share yet. It's still being considered but as @xumins mentioned this would be for the next version. Things would need to change inside the nanoserver image to support downloading and installing Nano Server feature packages through PowerShell or DSC