Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set console formatter to JSON in ASP.NET Core images #2748

Merged
merged 3 commits into from
Apr 19, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions eng/dockerfile-templates/aspnet/6.0/Dockerfile.alpine
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
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 \
ASPNET_VERSION={{VARIABLES["aspnet|6.0|build-version"]}} \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Rich's recent PR to refactor the first run, he added a comment for the SDK_VERSION. Thoughts on doing a similar thing for the ASPNET_VERSION?

Referenced change - 34775be

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doh, need to regen

# 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
5 changes: 4 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,9 @@ 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 \
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"]
5 changes: 4 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,9 @@ 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 `
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,10 @@
ARG REPO=mcr.microsoft.com/dotnet/runtime
FROM $REPO:6.0-{{OS_VERSION}}

ENV ASPNET_VERSION={{VARIABLES["aspnet|6.0|build-version"]}}
ENV `
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
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
7 changes: 5 additions & 2 deletions src/aspnet/6.0/alpine3.13/amd64/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
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.4.21213.1
ENV \
ASPNET_VERSION=6.0.0-preview.4.21213.1 \
# 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='255c894c51a7c2263b19e15382da41307eb5ee6ade959a805f55a36c51b7986a30d07ca0b944a23c18ac6da6e9b2b7deb9a156d67b8ee34aad0ff10ffef613aa' \
&& echo "$aspnetcore_sha512 aspnetcore.tar.gz" | sha512sum -c - \
Expand Down
7 changes: 5 additions & 2 deletions src/aspnet/6.0/alpine3.13/arm32v7/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
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.4.21213.1
ENV \
ASPNET_VERSION=6.0.0-preview.4.21213.1 \
# 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='e4bd8c2abac5e92f5efae6f40f0423d469e221cf0652d151b90e488fa9479e0ef5958497684ae811eb306a351fc625f84be1bd97842b86f138479ac9ddeabdc4' \
&& echo "$aspnetcore_sha512 aspnetcore.tar.gz" | sha512sum -c - \
Expand Down
7 changes: 5 additions & 2 deletions src/aspnet/6.0/alpine3.13/arm64v8/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
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.4.21213.1
ENV \
ASPNET_VERSION=6.0.0-preview.4.21213.1 \
# 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='b2b8f2981247e2158a42d73dc02b09879bb626f7e97b0637dad6c971ca1aed0eed6200b5574c5a5ea836bf3b8344de3ffe925256c528268a04195a92a0d3b3a8' \
&& echo "$aspnetcore_sha512 aspnetcore.tar.gz" | sha512sum -c - \
Expand Down
5 changes: 4 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,9 @@ 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 \
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"]
5 changes: 4 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,9 @@ 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 \
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"]
5 changes: 4 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,9 @@ 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 \
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"]
5 changes: 4 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,9 @@ 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 \
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"]
5 changes: 4 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,9 @@ 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 \
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"]
5 changes: 4 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,9 @@ 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 \
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"]
5 changes: 4 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,9 @@ 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 `
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"]
5 changes: 4 additions & 1 deletion src/aspnet/6.0/nanoserver-1909/amd64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ RUN Invoke-WebRequest -OutFile aspnetcore.zip https://dotnetcli.azureedge.net/do
FROM $REPO:6.0-nanoserver-1909
ARG ASPNET_VERSION

ENV ASPNET_VERSION=$ASPNET_VERSION
ENV `
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"]
5 changes: 4 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,9 @@ 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 `
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"]
5 changes: 4 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,9 @@ 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 `
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,10 @@
ARG REPO=mcr.microsoft.com/dotnet/runtime
FROM $REPO:6.0-windowsservercore-ltsc2019

ENV ASPNET_VERSION=6.0.0-preview.4.21213.1
ENV `
ASPNET_VERSION=6.0.0-preview.4.21213.1 `
# 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.4.21215.1 \
# 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.4.21215.1 \
# 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.4.21215.1 \
# 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.4.21215.1 \
# 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.4.21215.1 \
# 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.4.21215.1 \
# 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-1909/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.4.21215.1 `
# 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