What's the correct Windows Base Image for ASP.NET Core 2.1 Docker Containers on Azure App Services

风格不统一 提交于 2019-12-04 14:58:42
Vini Soto

The issue lies in the fact that microsoft/dotnet:2.1-aspnetcore-runtime is a multi-architecture base image. This means that Docker build will pick the best architecture for your local machine (the machine where you are building your docker image). I assume that your local machine is Windows 10 April 2018 Update (Version 1803 - Whose build number 17134.407). As of now, we only support images based off of Windows Server 2016 (Version 1709, up to build number 14393.XX).

In order to “force” a specific version, please use this base image instead: microsoft/dotnet:2.1-aspnetcore-runtime-nanoserver-sac2016. You can check all the available tags in https://hub.docker.com/r/microsoft/dotnet/

We will work on calling this out specifically in our documentation.

Is important to mention that Windows Containers on App Service is currently in Preview.

The validation on the portal "Cannot run this Operating System/Version in Windows Containers. Maximum supported OS version is 10.0.14393.9999." is shown because we are running the servers with Windows Server 2016 RS1 and currently can't run containers for RS3+. We are currently working on enabling them, but we don't have an ETA to share at this point.

If the validation passes, it means that the specified image should work fine and the issue you are seeing is not directly related to the image. It is a bug in the platform and it seems similar to the issue reported here: https://github.com/Microsoft/hcsshim/issues/155

We will continue investigating and thanks for reporting the issue

The answer above that was marked as an answer is not correct. It leads you to believe that using microsoft/dotnet:2.1-aspnetcore-runtime-nanoserver-sac2016 will solve your problems, but it won't. I tested this on Azure Container instances, and it does not work.

The solutions is this: when you get OsVersionNotSupported it means that the image was create with windows version that is not supported, and Microsoft currently does not support any SAC versions (SAC is Semi-Annual Channel). So versions like 1709 and 1803 will NOT WORK. Also the "solution" above is not going to work, since it uses that tag of SAC2016.

For all tags that you can use in docker file, go here: https://github.com/dotnet/dotnet-docker/blob/master/TAGS.md

You need to go to https://docs.microsoft.com/en-us/azure/container-instances/container-instances-troubleshooting and read the section "OS version of image not supported". It clearly states that you need to "...always deploy Windows Server 2016 (LTSC)-based images...".

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!