Azure-docs: Windows images ACR Build

Created on 20 Sep 2019  Â·  22Comments  Â·  Source: MicrosoftDocs/azure-docs

Please could you update docs which base OS is used for build on --Platform Windows ? I need to build docker image on Windows 2019. Is it possible ?


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri1 container-registrsvc cxp doc-enhancement triaged

All 22 comments

@jjindrich
Thanks for the feedback! We are currently investigating and will update you shortly.

@dlepow whats the build image used for windows containers?
Please add your comments

@jjindrich - We might need more info from the ACR team, but I was able to use az acr build and az acr task run to manually trigger build of a couple of test images using Windows Server 2019 base images specified in the Dockerfile. I built from official nanoserver and windows/servercore images (both available from Microsoft Container Registry). Which 2019 image do you plan to use as a base? Thanks.
cc/ @northtyphoon @sajayantony

Hi, I'm building webapp based on dotNET core 2.1. Runnning command az acr build -r myacr https://github.com/tkubica12/dotnetcore-sqldb-tutorial.git -f Dockerfile --platform Windows -t web:0-windows
Docker image is created but when I run it on Azure Container Instance getting error about wrong base image. You can check it

/cc @northtyphoon

Getting this error from ACI deployment: {"code":"DeploymentFailed","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-debug for usage details.","details":[{"code":"BadRequest","message":"{\r\n \"error\": {\r\n \"code\": \"OsVersionNotSupported\",\r\n \"message\": \"The Windows version of image 'cpacr6aznnn7mvnpci.azurecr.io/cpweb:0-windows' is not supported. The supported Windows versions are: '10.0.14393,10.0.17763'.\"\r\n }\r\n}"}]}

Using base image mcr.microsoft.com/dotnet/core/aspnet:2.1

@jjindrich please update base image to mcr.microsoft.com/dotnet/core/aspnet:2.1-nanoserver-1809, 1809 build version is "10.0.17763" which is supported by ACI.
https://hub.docker.com/_/microsoft-dotnet-core-aspnet

Yes, this workaround I can use. But Azure App Service requires Window2019. It doesn't make sense to update dockerfile for each Azure service. When ACR will use Windows2019 ?

@dlepow - Can you loop in someone from the ACI team since the deployment is failing since it sounds like missing support in Container Instances.

ACR supports both versions but the chosen default isn't compatible with ACI is my understanding.

@jjindrich - For windows containers the general guidance has been to use platform specific tags to avoid host and container runtime mismatch, this is also why windows is deprecating latest. ACR build will continue to support building for different windows versions and the underlying defaults will move ahead with new releases of windows and so for guaranteed behavior the platform tag is what we recommend.

When ACR will use Windows2019 ?

@northtyphoon - Please comment here - Does ACR build support both 1809 and 1903 versions and is Windows2019 - 1903

I guess what you mean by "Windows2019" is actually 1809. 1809 is the long-term servicing channel and supported by most Azure services.

https://docs.microsoft.com/en-us/virtualization/windowscontainers/deploy-containers/version-compatibility

OK. I can confirm the version supported by App Service is 1809.

https://docs.microsoft.com/en-us/azure/app-service/app-service-web-get-started-windows-container#use-a-different-parent-image

Per Container Instances doc, the following Windows 2019 base images can be used there (currently as preview):

Nano Server: 1809, 10.0.17763.x
Windows Server Core: ltsc2019, 1809, 10.0.17763.x
Windows: 1809, 10.0.17763.x

I believe the matrix is up to date but looping the ACI team who might have latest info.
cc/ @dkkapur

Thanks, @dlepow how can I enable preview ?

@jjindrich - I should have been clearer :). You can deploy images to ACI based on those Win2019 base images without further ACI configuration. Preview only refers to the level of support and to highlight that this list is subject to change. We can continue conversation in corp email if that's easier. Thanks!

@sajayantony I don't want change docker file because is same for Windows and Linux build. Can I somehow say ACR to use 1809 server for building ? Instead of latest 1903 ?

Maybe a buildArg with a default value you can override ? @northtyphoon did we rollout support for build arts?

Dockerfile

ARG BASE_IMAGE=mcr.microsoft.com/dotnet/core/aspnet:2.1
FROM ${BASE_IMAGE}
...

CLI

az acr build --build-arg BASE_IMAGE=mcr.microsoft.com/dotnet/core/aspnet:2.1-nanoserver-1809 -f Dockerfile --platform Windows -t web:0-windows

@northtyphoon thanks, but you have to change dockerfile, correct ? I was meaning find the way to tell ACR build service use different server version where is build running. Like on Azure DevOPs task you are selecting OS.

Not sure what is your concern about "change dockerfile". What we suggest is to make Dockerfile a little flexible which allows you to override the base image when you launch the build through --build-arg.

ok, understand. So nearly we can close this ticket, only i want to ask you update ACR docs. @northtyphoon please update which host servers are used for ACR task. Because for Windows is building images on too new windows versions.

@dlepow - can you help with the build documentation to include recommendation on how to pin your build to a specific version of windows since ACR build always takes its version of windows when pulling an image.

Was this page helpful?
0 / 5 - 0 ratings