I noticed this flag being checked in the startup logs of a Windows container. I've tried setting it to 1 since I'm having startup issues, but other than the logs indicating that it skipped configuration, there's no clue what that entails. Any more info?
Arian Kulp's questions
I've been struggling for over a week to get a Windows container to run with an Azure App Service. My initial preference was to just use a standard container instance, but it appears that you only have the option of public or private networking, rather than custom (unlike with Linux containers). It looks like if you run your Windows container within an app service, you get the same networking options you get with other web sites. Azure support for Windows containers in App Services is nearly a year old, but relatively few resources address it, other than very basic scenarios.
My purpose in using a container is to run a third-party background Windows service on-demand without the overhead of a VM. Since it's using an app service, I decided to add an asp.net core rest endpoint for some status info. My container is based on mcr.microsoft.com/windows/servercore:ltsc2019
. I download and install .net and asp.net core (the base image has .net framework only), install my services, build and run the web site, then my entrypoint is a Powershell script that updates some config values and runs the asp.net core endpoint which manages the services.
If I use the portal, I can select the options for container vs code, Windows vs Linux, and get things to start with the basic quickstart image, but my own image in Azure Container Registry doesn't start properly. I'm using one of the supported base images, and it runs fine on my local machine. On Azure, it creates everything, but it never starts up. The small amount of logging indicates that it starts it up, mounts file share volumes, then basically just dies:
- Create container for image
- Attempting to start container
- Start container succeeded
- Container has started
- Call configure container utility
- Configure container utility completed
- Container has started
- Attempting to stop container
- Attempting to terminate container
- Attempting to remove container
- Container removed successfully
Also odd, even with the quickstart image, I don't see an actual Container Instance. Presumably this is because it's running in the App Service Plan directly, though none of that is very clear. From the web app, I can go to the App Service Plan (Windows Containers plan) where, under Apps, it shows a single app with type of "app,container,windows", but nowhere can I find access to view console logs or run a shell like I can with resources of type Container Image. In some screenshots I've come across, I can see a "Container Settings" link under "Settings" which I don't have, but perhaps that's only for Linux containers for some reason.
So, how should I be troubleshooting container issues when running within an app service? Am I missing something somewhere?
I'm trying to use Visual Studio 2019 to develop a ASP.NET Core 3.1 app running in Docker for Windows. I'm having a few problems with this. I need to host an endpoint to start and stop a service and provide some health check info. The services are installed from a third-party MSI (I'd love to just copy files over, but we don't want to run it unsupported, plus it's files and registry changes). The basic (dotnet/sdk, /core, and /aspnet) images are based on Nano Server so don't support MSI/msiexec. I've tried a large number of images to find one that supports ASP.Net Core plus msiexec (Server Core), but it seems like only the large images fit our needs (8+ GB vs <500MB for the Nano ones). Is there another possibility here? At this point, I can't even get the build to work consistently. Files will build but not end up in the final image, and if they make it I can't seem to hit them (trying ports 80/443, 5000/5001, or the actual Docker-exposed ports, with localhost or the container's IP address). It's getting pretty frustrating! I'd love any help.
- Finding a reasonably-sized image that supports ASP.net Core 3.1 and msiexec
- Build process to properly publish and copy files to the final image
- Service to be accessible from outside the container.
Current dockerfile:
FROM mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
# INSTALL dotnet
ADD https://download.visualstudio.microsoft.com/download/pr/c37ece76-1305-4042-a9e6-58e7cb1b0bf6/75c20ff59335e370985b4f03fa637fcb/aspnetcore-runtime-3.1.18-win-x64.exe /symedical/
ADD https://download.visualstudio.microsoft.com/download/pr/7d09d7c0-8902-4467-9268-d7f584923cde/eddcb12257e68b030bc1b4baf9a68681/dotnet-runtime-3.1.18-win-x64.exe /symedical/
RUN C:/symedical/aspnetcore-runtime-3.1.18-win-x64.exe /install /quiet /norestart && \
C:/symedical/dotnet-runtime-3.1.18-win-x64.exe /install /quiet
ARG InstallerSrc="dist/installers/ThirdPartyClientServices.msi"
ARG InstallerDest="/install/"
ADD ${InstallerSrc} ${InstallerDest}
ARG InstallerSrc="dist/scripts/"
ADD ${InstallerSrc} ${InstallerDest}
RUN powershell -file "c:\dist\scripts\install-msi.ps1"
######
FROM mcr.microsoft.com/dotnet/sdk:3.1 AS build
WORKDIR /src
COPY ["Distribution/Distribution.csproj", "Distribution/"]
RUN dotnet restore "Distribution/Distribution.csproj"
COPY . .
WORKDIR "/src/Distribution"
RUN dotnet build "Distribution.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "Distribution.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Distribution.dll"]