Choco: Support Windows Nano Server

Created on 28 Jul 2017  路  15Comments  路  Source: chocolatey/choco

The chocolatey install (install.ps1) does not work with NanoServer image for Docker, mainly because WebClient is not supported. A workaround would be to use Invoke-WebRequest instead.
See: https://docs.microsoft.com/en-us/virtualization/windowscontainers/manage-docker/manage-windows-dockerfile

I'm still trying to install it by hand and let you know if there are other problems.

0 - Backlog 0 - _Triaging CoreTeam Enhancement

Most helpful comment

Any update on this item? Not sure if other's have encountered, but windowsservercore images often have incorrect time vs. the host while the nanoserver image is fine. So, it would be great to work with chocolatey in nanoserver containers as Microsoft does not have an ETA on fixing the time issue in windowsservercore images...

All 15 comments

Chocolatey doesn't work on Nano Server yet, so let's set this up as an enhancement ticket.

You can get an idea of availability of this based on our roadmap at https://chocolatey.org/docs/roadmap#chocolatey. We are projecting early 2018 based on the current prioritization schedule.

For Docker, if you want Chocolatey functionality, use Windows Server Core for now.

Any update on this item? Not sure if other's have encountered, but windowsservercore images often have incorrect time vs. the host while the nanoserver image is fine. So, it would be great to work with chocolatey in nanoserver containers as Microsoft does not have an ETA on fixing the time issue in windowsservercore images...

On roadmap it shows:

Windows Nano Support - on hold, waiting for official stance from Microsoft

Did anything change in this regard since this was posted (or any info or status) ?

yes this will be awesome

Dockerfile:

FROM mcr.microsoft.com/powershell:nanoserver-1809

SHELL ["pwsh", "-ExecutionPolicy", "Bypass", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

RUN iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

Gives error:

> docker build  .
Sending build context to Docker daemon  3.072kB
Step 1/3 : FROM mcr.microsoft.com/powershell:nanoserver-1809
 ---> caa1afbff902
Step 2/3 : SHELL ["pwsh", "-ExecutionPolicy", "Bypass", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
 ---> Running in 68667fa80e2c
Removing intermediate container 68667fa80e2c
 ---> 4d9a7c7df0e8
Step 3/3 : RUN iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
 ---> Running in 250dd124b5a7
Unable to set PowerShell to use TLS 1.2 and TLS 1.1 due to old .NET Framework installed. If you see underlying connection closed or trust errors, you may need to do one or more of the following: (1) upgrade to .NET Framework 4.5+ and PowerShell v3, (2) specify internal Chocolatey package location (set $env:chocolateyDownloadUrl prior to install or host the package internally), (3) use the Download + PowerShell method of install. See https://chocolatey.org/install for all install options.
Getting latest version of the Chocolatey package for download.
iex : Exception calling "IsBypassed" with "1" argument(s): "Operation is not supported on this platform."
At line:1 char:76
+ ... yContinue'; iex ((New-Object System.Net.WebClient).DownloadString('ht ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [Invoke-Expression], MethodInvocationException
+ FullyQualifiedErrorId : PlatformNotSupportedException,Microsoft.PowerShell.Commands.InvokeExpressionCommand

The command 'pwsh -ExecutionPolicy Bypass -Command $ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue'; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))' returned a non-zero code: 1

Any update on this?

Screenshot from 2019-07-01 12-11-29

This is on hold and has been for a while. Waiting to learn where Nano Server is going. It doesn't seem to be something that is going to be a long term thing based on not much movement on the platform and being deregulated awhile back. Does anyone have something different they have noticed here?

Does anyone have something different they have noticed here?

Nanoserver is not going away! In fact, it's the recommended "small" Microsoft container base OS. Note that servercore is much slower and larger, so not recommended for large prod environments. Yet that means we can't easily install a package inside a Dockerfile with choco

Yet that means we can't easily install a package inside a Dockerfile with choco

I mean you can with servercore and people do it all the time, including Microsoft. https://github.com/Microsoft/vsts-agent-docker/blob/f870fbf259a803c6a6d902e1c01f631936069d66/windows/servercore/10.0.14393/standard/VS2017/Dockerfile

To me, regardless of the OS version I think chocolatey should support Powershell Core for lighter installations. Not sure how that viable would be.

To support Nano Server, we need to get to .NET Core. We make heavy use of refection among other things. So there are some aspects necessary to be resolved to allow us to get to .NET Core first, which block running Chocolatey on Nano Server. Those are not going to be resolved in the near term but it's possible at some point in the future. It's not that we are actively trying to keep Chocolatey out of Nano Server, but Nano Server would need to support the version of .NET Core that choco would be able to first come available on.

@lmayorga1980 PowerShell core is a different conversation than this although it is very similar. As Chocolatey has a built in PowerShell Host, there are more aspects to this that must be resolved.

I mean you can with servercore and people do it all the time, including Microsoft.

Servercore is 10 times the size of nanoserver (literally) and a lot slower when starting/stopping/building containers.

@franklouwers Thank you, this is already well-known information. If Server Core is not acceptable in its times of starting, stopping, and building containers, then you should continue to use Nano Server. For other organizations, the tradeoffs of size and provisioning times appear acceptable. There are other technical hurdles in what Nano can and cannot support and contribute to the reasons organizations end up with Server Core - there is no need to get into them here as they are also well-known to our team.

I don't think microsoft are going to bring the full .net into server nano. Is the only thing stopping chocolatey being used in server nano a rewrite in .net core or are there other things?

https://windowsserver.uservoice.com/forums/295068-core-server/suggestions/8106009-enable-full-net-framework-on-nano

Windows Nano Support - on hold, waiting for official stance from Microsoft

maybe you should update your roadmap..

Was this page helpful?
0 / 5 - 0 ratings