Skip to content

Commit

Permalink
Set console formatter to JSON in ASP.NET Core images (dotnet#2748)
Browse files Browse the repository at this point in the history
  • Loading branch information
mthalman committed May 25, 2021
1 parent 752a3f3 commit 2251927
Show file tree
Hide file tree
Showing 36 changed files with 129 additions and 21 deletions.
8 changes: 6 additions & 2 deletions eng/dockerfile-templates/aspnet/6.0/Dockerfile.alpine
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
ARG REPO=mcr.microsoft.com/dotnet/runtime
FROM $REPO:6.0-{{OS_VERSION}}{{ARCH_TAG_SUFFIX}}

# Install ASP.NET Core
ENV ASPNET_VERSION={{VARIABLES["aspnet|6.0|build-version"]}}
ENV \
# ASP.NET Core version
ASPNET_VERSION={{VARIABLES["aspnet|6.0|build-version"]}} \
# Set the default console formatter to JSON
Logging__Console__FormatterName=Json

# Install ASP.NET Core
RUN wget -O aspnetcore.tar.gz https://dotnetcli.azureedge.net/dotnet/aspnetcore/Runtime/$ASPNET_VERSION/aspnetcore-runtime-$ASPNET_VERSION-linux-musl-{{ARCH_SHORT}}.tar.gz \
&& aspnetcore_sha512='{{VARIABLES[cat("aspnet|6.0|linux-musl|", ARCH_SHORT, "|sha")]}}' \
&& echo "$aspnetcore_sha512 aspnetcore.tar.gz" | sha512sum -c - \
Expand Down
6 changes: 5 additions & 1 deletion eng/dockerfile-templates/aspnet/6.0/Dockerfile.linux
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ RUN curl -SL --output aspnetcore.tar.gz https://dotnetcli.azureedge.net/dotnet/a
FROM $REPO:6.0-{{OS_VERSION}}{{ARCH_TAG_SUFFIX}}
ARG ASPNET_VERSION

ENV ASPNET_VERSION=$ASPNET_VERSION
ENV \
# ASP.NET Core version
ASPNET_VERSION=$ASPNET_VERSION \
# Set the default console formatter to JSON
Logging__Console__FormatterName=Json

COPY --from=installer ["/shared/Microsoft.AspNetCore.App", "/usr/share/dotnet/shared/Microsoft.AspNetCore.App"]
6 changes: 5 additions & 1 deletion eng/dockerfile-templates/aspnet/6.0/Dockerfile.nanoserver
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ RUN Invoke-WebRequest -OutFile aspnetcore.zip https://dotnetcli.azureedge.net/do
FROM $REPO:6.0-{{OS_VERSION}}
ARG ASPNET_VERSION

ENV ASPNET_VERSION=$ASPNET_VERSION
ENV `
# ASP.NET Core version
ASPNET_VERSION=$ASPNET_VERSION `
# Set the default console formatter to JSON
Logging__Console__FormatterName=Json

COPY --from=installer ["/dotnet/shared/Microsoft.AspNetCore.App", "/Program Files/dotnet/shared/Microsoft.AspNetCore.App"]
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
ARG REPO=mcr.microsoft.com/dotnet/runtime
FROM $REPO:6.0-{{OS_VERSION}}

ENV ASPNET_VERSION={{VARIABLES["aspnet|6.0|build-version"]}}
ENV `
# ASP.NET Core version
ASPNET_VERSION={{VARIABLES["aspnet|6.0|build-version"]}} `
# Set the default console formatter to JSON
Logging__Console__FormatterName=Json

RUN powershell -Command `
$ErrorActionPreference = 'Stop'; `
Expand Down
2 changes: 2 additions & 0 deletions eng/dockerfile-templates/sdk/6.0/Dockerfile.alpine
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ ENV \
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false \
# Enable correct mode for dotnet watch (only mode supported in a container)
DOTNET_USE_POLLING_FILE_WATCHER=true \
# Unset Logging__Console__FormatterName from aspnet base image
Logging__Console__FormatterName= \
# Skip extraction of XML docs - generally not useful within an image/container - helps performance
NUGET_XMLDOC_MODE=skip \
# PowerShell telemetry for docker image usage
Expand Down
2 changes: 2 additions & 0 deletions eng/dockerfile-templates/sdk/6.0/Dockerfile.linux
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ ENV \
DOTNET_SDK_VERSION={{VARIABLES["sdk|6.0|build-version"]}} \
# Enable correct mode for dotnet watch (only mode supported in a container)
DOTNET_USE_POLLING_FILE_WATCHER=true \
# Unset Logging__Console__FormatterName from aspnet base image
Logging__Console__FormatterName= \
# Skip extraction of XML docs - generally not useful within an image/container - helps performance
NUGET_XMLDOC_MODE=skip \
# PowerShell telemetry for docker image usage
Expand Down
2 changes: 2 additions & 0 deletions eng/dockerfile-templates/sdk/6.0/Dockerfile.nanoserver
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ ENV `
DOTNET_SDK_VERSION=$DOTNET_SDK_VERSION `
# Enable correct mode for dotnet watch (only mode supported in a container)
DOTNET_USE_POLLING_FILE_WATCHER=true `
# Unset Logging__Console__FormatterName from aspnet base image
Logging__Console__FormatterName= `
# Skip extraction of XML docs - generally not useful within an image/container - helps performance
NUGET_XMLDOC_MODE=skip `
# PowerShell telemetry for docker image usage
Expand Down
2 changes: 2 additions & 0 deletions eng/dockerfile-templates/sdk/6.0/Dockerfile.windowsservercore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ ENV `
DOTNET_SDK_VERSION={{VARIABLES["sdk|6.0|build-version"]}} `
# Enable correct mode for dotnet watch (only mode supported in a container)
DOTNET_USE_POLLING_FILE_WATCHER=true `
# Unset Logging__Console__FormatterName from aspnet base image
Logging__Console__FormatterName= `
# Skip extraction of XML docs - generally not useful within an image/container - helps performance
NUGET_XMLDOC_MODE=skip `
# PowerShell telemetry for docker image usage
Expand Down
8 changes: 6 additions & 2 deletions src/aspnet/6.0/alpine3.13/amd64/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
ARG REPO=mcr.microsoft.com/dotnet/runtime
FROM $REPO:6.0-alpine3.13-amd64

# Install ASP.NET Core
ENV ASPNET_VERSION=6.0.0-preview.3.21201.13
ENV \
# ASP.NET Core version
ASPNET_VERSION=6.0.0-preview.3.21201.13 \
# Set the default console formatter to JSON
Logging__Console__FormatterName=Json

# Install ASP.NET Core
RUN wget -O aspnetcore.tar.gz https://dotnetcli.azureedge.net/dotnet/aspnetcore/Runtime/$ASPNET_VERSION/aspnetcore-runtime-$ASPNET_VERSION-linux-musl-x64.tar.gz \
&& aspnetcore_sha512='80d451713218d1d0ce89d5d0e5205d82811e0a58aac299403cb7fd305f5f70acbe3b21854d2ff85d7666a48a083571c7ea661c7499f8900cac6571732876f831' \
&& echo "$aspnetcore_sha512 aspnetcore.tar.gz" | sha512sum -c - \
Expand Down
8 changes: 6 additions & 2 deletions src/aspnet/6.0/alpine3.13/arm32v7/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
ARG REPO=mcr.microsoft.com/dotnet/runtime
FROM $REPO:6.0-alpine3.13-arm32v7

# Install ASP.NET Core
ENV ASPNET_VERSION=6.0.0-preview.3.21201.13
ENV \
# ASP.NET Core version
ASPNET_VERSION=6.0.0-preview.3.21201.13 \
# Set the default console formatter to JSON
Logging__Console__FormatterName=Json

# Install ASP.NET Core
RUN wget -O aspnetcore.tar.gz https://dotnetcli.azureedge.net/dotnet/aspnetcore/Runtime/$ASPNET_VERSION/aspnetcore-runtime-$ASPNET_VERSION-linux-musl-arm.tar.gz \
&& aspnetcore_sha512='afd79e40125db4fc6907b4900060f76590762555d89c4baefb9fd87cd4e522db5144e59d777c7c9ecc51c9478b8f61cb921a8f17b48e36940f1e4cf7f1b24e09' \
&& echo "$aspnetcore_sha512 aspnetcore.tar.gz" | sha512sum -c - \
Expand Down
8 changes: 6 additions & 2 deletions src/aspnet/6.0/alpine3.13/arm64v8/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
ARG REPO=mcr.microsoft.com/dotnet/runtime
FROM $REPO:6.0-alpine3.13-arm64v8

# Install ASP.NET Core
ENV ASPNET_VERSION=6.0.0-preview.3.21201.13
ENV \
# ASP.NET Core version
ASPNET_VERSION=6.0.0-preview.3.21201.13 \
# Set the default console formatter to JSON
Logging__Console__FormatterName=Json

# Install ASP.NET Core
RUN wget -O aspnetcore.tar.gz https://dotnetcli.azureedge.net/dotnet/aspnetcore/Runtime/$ASPNET_VERSION/aspnetcore-runtime-$ASPNET_VERSION-linux-musl-arm64.tar.gz \
&& aspnetcore_sha512='09211c57972a5b2751cf6ba8947d62088974e73fdd1db4e52674dd460dc743ed58180e89434563170b99d735eec0fb88ac4c641076cbfe618c5d83a7708d9925' \
&& echo "$aspnetcore_sha512 aspnetcore.tar.gz" | sha512sum -c - \
Expand Down
6 changes: 5 additions & 1 deletion src/aspnet/6.0/bullseye-slim/amd64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ RUN curl -SL --output aspnetcore.tar.gz https://dotnetcli.azureedge.net/dotnet/a
FROM $REPO:6.0-bullseye-slim-amd64
ARG ASPNET_VERSION

ENV ASPNET_VERSION=$ASPNET_VERSION
ENV \
# ASP.NET Core version
ASPNET_VERSION=$ASPNET_VERSION \
# Set the default console formatter to JSON
Logging__Console__FormatterName=Json

COPY --from=installer ["/shared/Microsoft.AspNetCore.App", "/usr/share/dotnet/shared/Microsoft.AspNetCore.App"]
6 changes: 5 additions & 1 deletion src/aspnet/6.0/bullseye-slim/arm32v7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ RUN curl -SL --output aspnetcore.tar.gz https://dotnetcli.azureedge.net/dotnet/a
FROM $REPO:6.0-bullseye-slim-arm32v7
ARG ASPNET_VERSION

ENV ASPNET_VERSION=$ASPNET_VERSION
ENV \
# ASP.NET Core version
ASPNET_VERSION=$ASPNET_VERSION \
# Set the default console formatter to JSON
Logging__Console__FormatterName=Json

COPY --from=installer ["/shared/Microsoft.AspNetCore.App", "/usr/share/dotnet/shared/Microsoft.AspNetCore.App"]
6 changes: 5 additions & 1 deletion src/aspnet/6.0/bullseye-slim/arm64v8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ RUN curl -SL --output aspnetcore.tar.gz https://dotnetcli.azureedge.net/dotnet/a
FROM $REPO:6.0-bullseye-slim-arm64v8
ARG ASPNET_VERSION

ENV ASPNET_VERSION=$ASPNET_VERSION
ENV \
# ASP.NET Core version
ASPNET_VERSION=$ASPNET_VERSION \
# Set the default console formatter to JSON
Logging__Console__FormatterName=Json

COPY --from=installer ["/shared/Microsoft.AspNetCore.App", "/usr/share/dotnet/shared/Microsoft.AspNetCore.App"]
6 changes: 5 additions & 1 deletion src/aspnet/6.0/focal/amd64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ RUN curl -SL --output aspnetcore.tar.gz https://dotnetcli.azureedge.net/dotnet/a
FROM $REPO:6.0-focal-amd64
ARG ASPNET_VERSION

ENV ASPNET_VERSION=$ASPNET_VERSION
ENV \
# ASP.NET Core version
ASPNET_VERSION=$ASPNET_VERSION \
# Set the default console formatter to JSON
Logging__Console__FormatterName=Json

COPY --from=installer ["/shared/Microsoft.AspNetCore.App", "/usr/share/dotnet/shared/Microsoft.AspNetCore.App"]
6 changes: 5 additions & 1 deletion src/aspnet/6.0/focal/arm32v7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ RUN curl -SL --output aspnetcore.tar.gz https://dotnetcli.azureedge.net/dotnet/a
FROM $REPO:6.0-focal-arm32v7
ARG ASPNET_VERSION

ENV ASPNET_VERSION=$ASPNET_VERSION
ENV \
# ASP.NET Core version
ASPNET_VERSION=$ASPNET_VERSION \
# Set the default console formatter to JSON
Logging__Console__FormatterName=Json

COPY --from=installer ["/shared/Microsoft.AspNetCore.App", "/usr/share/dotnet/shared/Microsoft.AspNetCore.App"]
6 changes: 5 additions & 1 deletion src/aspnet/6.0/focal/arm64v8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ RUN curl -SL --output aspnetcore.tar.gz https://dotnetcli.azureedge.net/dotnet/a
FROM $REPO:6.0-focal-arm64v8
ARG ASPNET_VERSION

ENV ASPNET_VERSION=$ASPNET_VERSION
ENV \
# ASP.NET Core version
ASPNET_VERSION=$ASPNET_VERSION \
# Set the default console formatter to JSON
Logging__Console__FormatterName=Json

COPY --from=installer ["/shared/Microsoft.AspNetCore.App", "/usr/share/dotnet/shared/Microsoft.AspNetCore.App"]
6 changes: 5 additions & 1 deletion src/aspnet/6.0/nanoserver-1809/amd64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ RUN Invoke-WebRequest -OutFile aspnetcore.zip https://dotnetcli.azureedge.net/do
FROM $REPO:6.0-nanoserver-1809
ARG ASPNET_VERSION

ENV ASPNET_VERSION=$ASPNET_VERSION
ENV `
# ASP.NET Core version
ASPNET_VERSION=$ASPNET_VERSION `
# Set the default console formatter to JSON
Logging__Console__FormatterName=Json

COPY --from=installer ["/dotnet/shared/Microsoft.AspNetCore.App", "/Program Files/dotnet/shared/Microsoft.AspNetCore.App"]
6 changes: 5 additions & 1 deletion src/aspnet/6.0/nanoserver-2004/amd64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ RUN Invoke-WebRequest -OutFile aspnetcore.zip https://dotnetcli.azureedge.net/do
FROM $REPO:6.0-nanoserver-2004
ARG ASPNET_VERSION

ENV ASPNET_VERSION=$ASPNET_VERSION
ENV `
# ASP.NET Core version
ASPNET_VERSION=$ASPNET_VERSION `
# Set the default console formatter to JSON
Logging__Console__FormatterName=Json

COPY --from=installer ["/dotnet/shared/Microsoft.AspNetCore.App", "/Program Files/dotnet/shared/Microsoft.AspNetCore.App"]
6 changes: 5 additions & 1 deletion src/aspnet/6.0/nanoserver-20H2/amd64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ RUN Invoke-WebRequest -OutFile aspnetcore.zip https://dotnetcli.azureedge.net/do
FROM $REPO:6.0-nanoserver-20H2
ARG ASPNET_VERSION

ENV ASPNET_VERSION=$ASPNET_VERSION
ENV `
# ASP.NET Core version
ASPNET_VERSION=$ASPNET_VERSION `
# Set the default console formatter to JSON
Logging__Console__FormatterName=Json

COPY --from=installer ["/dotnet/shared/Microsoft.AspNetCore.App", "/Program Files/dotnet/shared/Microsoft.AspNetCore.App"]
6 changes: 5 additions & 1 deletion src/aspnet/6.0/windowsservercore-ltsc2019/amd64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
ARG REPO=mcr.microsoft.com/dotnet/runtime
FROM $REPO:6.0-windowsservercore-ltsc2019

ENV ASPNET_VERSION=6.0.0-preview.3.21201.13
ENV `
# ASP.NET Core version
ASPNET_VERSION=6.0.0-preview.3.21201.13 `
# Set the default console formatter to JSON
Logging__Console__FormatterName=Json

RUN powershell -Command `
$ErrorActionPreference = 'Stop'; `
Expand Down
2 changes: 2 additions & 0 deletions src/sdk/6.0/alpine3.13/amd64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ ENV \
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false \
# Enable correct mode for dotnet watch (only mode supported in a container)
DOTNET_USE_POLLING_FILE_WATCHER=true \
# Unset Logging__Console__FormatterName from aspnet base image
Logging__Console__FormatterName= \
# Skip extraction of XML docs - generally not useful within an image/container - helps performance
NUGET_XMLDOC_MODE=skip \
# PowerShell telemetry for docker image usage
Expand Down
2 changes: 2 additions & 0 deletions src/sdk/6.0/alpine3.13/arm32v7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ ENV \
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false \
# Enable correct mode for dotnet watch (only mode supported in a container)
DOTNET_USE_POLLING_FILE_WATCHER=true \
# Unset Logging__Console__FormatterName from aspnet base image
Logging__Console__FormatterName= \
# Skip extraction of XML docs - generally not useful within an image/container - helps performance
NUGET_XMLDOC_MODE=skip \
# PowerShell telemetry for docker image usage
Expand Down
2 changes: 2 additions & 0 deletions src/sdk/6.0/alpine3.13/arm64v8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ ENV \
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false \
# Enable correct mode for dotnet watch (only mode supported in a container)
DOTNET_USE_POLLING_FILE_WATCHER=true \
# Unset Logging__Console__FormatterName from aspnet base image
Logging__Console__FormatterName= \
# Skip extraction of XML docs - generally not useful within an image/container - helps performance
NUGET_XMLDOC_MODE=skip \
# PowerShell telemetry for docker image usage
Expand Down
2 changes: 2 additions & 0 deletions src/sdk/6.0/bullseye-slim/amd64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ ENV \
DOTNET_SDK_VERSION=6.0.100-preview.3.21202.5 \
# Enable correct mode for dotnet watch (only mode supported in a container)
DOTNET_USE_POLLING_FILE_WATCHER=true \
# Unset Logging__Console__FormatterName from aspnet base image
Logging__Console__FormatterName= \
# Skip extraction of XML docs - generally not useful within an image/container - helps performance
NUGET_XMLDOC_MODE=skip \
# PowerShell telemetry for docker image usage
Expand Down
2 changes: 2 additions & 0 deletions src/sdk/6.0/bullseye-slim/arm32v7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ ENV \
DOTNET_SDK_VERSION=6.0.100-preview.3.21202.5 \
# Enable correct mode for dotnet watch (only mode supported in a container)
DOTNET_USE_POLLING_FILE_WATCHER=true \
# Unset Logging__Console__FormatterName from aspnet base image
Logging__Console__FormatterName= \
# Skip extraction of XML docs - generally not useful within an image/container - helps performance
NUGET_XMLDOC_MODE=skip \
# PowerShell telemetry for docker image usage
Expand Down
2 changes: 2 additions & 0 deletions src/sdk/6.0/bullseye-slim/arm64v8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ ENV \
DOTNET_SDK_VERSION=6.0.100-preview.3.21202.5 \
# Enable correct mode for dotnet watch (only mode supported in a container)
DOTNET_USE_POLLING_FILE_WATCHER=true \
# Unset Logging__Console__FormatterName from aspnet base image
Logging__Console__FormatterName= \
# Skip extraction of XML docs - generally not useful within an image/container - helps performance
NUGET_XMLDOC_MODE=skip \
# PowerShell telemetry for docker image usage
Expand Down
2 changes: 2 additions & 0 deletions src/sdk/6.0/focal/amd64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ ENV \
DOTNET_SDK_VERSION=6.0.100-preview.3.21202.5 \
# Enable correct mode for dotnet watch (only mode supported in a container)
DOTNET_USE_POLLING_FILE_WATCHER=true \
# Unset Logging__Console__FormatterName from aspnet base image
Logging__Console__FormatterName= \
# Skip extraction of XML docs - generally not useful within an image/container - helps performance
NUGET_XMLDOC_MODE=skip \
# PowerShell telemetry for docker image usage
Expand Down
2 changes: 2 additions & 0 deletions src/sdk/6.0/focal/arm32v7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ ENV \
DOTNET_SDK_VERSION=6.0.100-preview.3.21202.5 \
# Enable correct mode for dotnet watch (only mode supported in a container)
DOTNET_USE_POLLING_FILE_WATCHER=true \
# Unset Logging__Console__FormatterName from aspnet base image
Logging__Console__FormatterName= \
# Skip extraction of XML docs - generally not useful within an image/container - helps performance
NUGET_XMLDOC_MODE=skip \
# PowerShell telemetry for docker image usage
Expand Down
2 changes: 2 additions & 0 deletions src/sdk/6.0/focal/arm64v8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ ENV \
DOTNET_SDK_VERSION=6.0.100-preview.3.21202.5 \
# Enable correct mode for dotnet watch (only mode supported in a container)
DOTNET_USE_POLLING_FILE_WATCHER=true \
# Unset Logging__Console__FormatterName from aspnet base image
Logging__Console__FormatterName= \
# Skip extraction of XML docs - generally not useful within an image/container - helps performance
NUGET_XMLDOC_MODE=skip \
# PowerShell telemetry for docker image usage
Expand Down
2 changes: 2 additions & 0 deletions src/sdk/6.0/nanoserver-1809/amd64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ ENV `
DOTNET_SDK_VERSION=$DOTNET_SDK_VERSION `
# Enable correct mode for dotnet watch (only mode supported in a container)
DOTNET_USE_POLLING_FILE_WATCHER=true `
# Unset Logging__Console__FormatterName from aspnet base image
Logging__Console__FormatterName= `
# Skip extraction of XML docs - generally not useful within an image/container - helps performance
NUGET_XMLDOC_MODE=skip `
# PowerShell telemetry for docker image usage
Expand Down
2 changes: 2 additions & 0 deletions src/sdk/6.0/nanoserver-2004/amd64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ ENV `
DOTNET_SDK_VERSION=$DOTNET_SDK_VERSION `
# Enable correct mode for dotnet watch (only mode supported in a container)
DOTNET_USE_POLLING_FILE_WATCHER=true `
# Unset Logging__Console__FormatterName from aspnet base image
Logging__Console__FormatterName= `
# Skip extraction of XML docs - generally not useful within an image/container - helps performance
NUGET_XMLDOC_MODE=skip `
# PowerShell telemetry for docker image usage
Expand Down
2 changes: 2 additions & 0 deletions src/sdk/6.0/nanoserver-20H2/amd64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ ENV `
DOTNET_SDK_VERSION=$DOTNET_SDK_VERSION `
# Enable correct mode for dotnet watch (only mode supported in a container)
DOTNET_USE_POLLING_FILE_WATCHER=true `
# Unset Logging__Console__FormatterName from aspnet base image
Logging__Console__FormatterName= `
# Skip extraction of XML docs - generally not useful within an image/container - helps performance
NUGET_XMLDOC_MODE=skip `
# PowerShell telemetry for docker image usage
Expand Down
2 changes: 2 additions & 0 deletions src/sdk/6.0/windowsservercore-ltsc2019/amd64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ ENV `
DOTNET_SDK_VERSION=6.0.100-preview.3.21202.5 `
# Enable correct mode for dotnet watch (only mode supported in a container)
DOTNET_USE_POLLING_FILE_WATCHER=true `
# Unset Logging__Console__FormatterName from aspnet base image
Logging__Console__FormatterName= `
# Skip extraction of XML docs - generally not useful within an image/container - helps performance
NUGET_XMLDOC_MODE=skip `
# PowerShell telemetry for docker image usage
Expand Down
5 changes: 5 additions & 0 deletions tests/Microsoft.DotNet.Docker.Tests/AspnetImageTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ public void VerifyEnvironmentVariables(ProductImageData imageData)
variables.Add(RuntimeImageTests.GetRuntimeVersionVariableInfo(imageData, DockerHelper));
}

if (imageData.Version.Major >= 6)
{
variables.Add(new EnvironmentVariableInfo("Logging__Console__FormatterName", "Json"));
}

base.VerifyCommonEnvironmentVariables(imageData, variables);
}

Expand Down
1 change: 1 addition & 0 deletions tests/Microsoft.DotNet.Docker.Tests/SdkImageTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public void VerifyEnvironmentVariables(ProductImageData imageData)
{
variables.Add(new EnvironmentVariableInfo("DOTNET_GENERATE_ASPNET_CERTIFICATE", "false"));
variables.Add(new EnvironmentVariableInfo("DOTNET_NOLOGO", "true"));
variables.Add(new EnvironmentVariableInfo("Logging__Console__FormatterName", string.Empty));
}

if (imageData.SdkOS.StartsWith(OS.AlpinePrefix))
Expand Down

0 comments on commit 2251927

Please sign in to comment.