Skip to content
This repository was archived by the owner on Jun 17, 2024. It is now read-only.
This repository was archived by the owner on Jun 17, 2024. It is now read-only.

Support windows containers base image nanoserver:2004 #40

@prabh-62

Description

@prabh-62

Thread continued from dotnet/dotnet-docker#2257

I created an ASP.NET 5 web api with .NET 5 RC1 SDK and created a docker image with self-contained version of web API.

Total size of docker image - 262 MB (nanoserver:2004) + 41 MB (self-container .NET 5 web API)

Tried to deploy with latest nanoserver base image(2004) on ACI (in East US region) and I get UnsupportedWindowsVersion error

FROM mcr.microsoft.com/windows/nanoserver:2004

container_base_error

Then, I tried with 1909 version, and got the same error on Azure Portal - UnsupportedWindowsVersion

FROM mcr.microsoft.com/windows/nanoserver:1909

Then with 1903, same error - UnsupportedWindowsVersion

FROM mcr.microsoft.com/windows/nanoserver:1903

Then downgraded further to 1809, and now I can't even run the API locally.

FROM mcr.microsoft.com/windows/nanoserver:1809
> docker run -p 8080:80 paymentsapp
Failed to map file. CreateFileMappingW(C:\app\PaymentsService.exe) failed with error 5
Failure processing application bundle.
Failed to map bundle file [C:\app\paymentsservice.runtimeconfig.json]

Continued downgrading further and now tried sac2016 version

FROM mcr.microsoft.com/windows/nanoserver:sac2016

And eventually, this base image worked and API successfully ran on ACI - http://paymentsapp.eastus.azurecontainer.io/api/health/stats
image

However, the deployed image size is 1.21 GB (Trying to keep image as small as 200 MB)
> docker history paymentsapp

IMAGE               CREATED             CREATED BY                                      SIZE                COMMENT
057ff3bd64f9        14 minutes ago      cmd /S /C #(nop)  ENTRYPOINT ["PaymentsServi…   41kB                
a8dabe8d62c8        14 minutes ago      cmd /S /C #(nop)  ENV DOTNET_RUNNING_IN_CONT…   41kB                
e0d49c798106        14 minutes ago      cmd /S /C #(nop)  ENV ASPNETCORE_URLS=http:/…   41kB                
129d6af5de48        14 minutes ago      cmd /S /C #(nop) COPY dir:753a5af31fb0b8f097…   41.9MB              
7849868f555d        14 minutes ago      cmd /S /C #(nop) WORKDIR C:\app                 41kB                
4c872414bf9d        23 months ago       Install update 10.0.14393.2551                  470MB               
<missing>           2 years ago         Apply image 10.0.14393.0                        701MB   

When can we deploy docker images with nanoserver:2004 on ACI?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions