Windows containers in Azure Container Instances - which base image to use?

110 Views Asked by At

I'm trying to get a very simple .net core console app to run in a windows container on Azure Container Instances but I'm having soo many problems.

First I attempted using the microsoft/dotnet:2.1-runtime as the base image but I can the error regarding the wrong windows version which has been reported at Azure Container Instance Windows Version Wrong. I've tried numerous different base images, some which run on my local machine and some that don't but I still can't find a base image which has dot net core on it and is a valid windows version for the ACI service. Can anyone point me in the direction of what base image I should be using? Or have I got completely the wrong end of the stick? TIA

FROM microsoft/dotnet:2.2-runtime AS base 
WORKDIR /app 

FROM microsoft/dotnet:2.2-sdk AS build 
WORKDIR /src 
COPY [<obfuscated>.csproj", "<obfuscated>./"] 
RUN dotnet restore "<obfuscated>.csproj" 
COPY . . 
WORKDIR "/src/<obfuscated>." 
RUN dotnet build "<obfuscated>.csproj" -c Release -o /app 

FROM build AS publish 
RUN dotnet publish "<obfuscated>..csproj" -c Release -o /app 
FROM base AS final WORKDIR /app 
COPY --from=publish /app . 
ENTRYPOINT ["dotnet", "<obfuscated>.dll"]
0

There are 0 best solutions below