ARG REPO=mcr.microsoft.com/dotnet/aspnet # Installer image FROM amd64/buildpack-deps:jammy-curl AS installer # Retrieve .NET Monitor Base RUN dotnet_monitor_version=8.1.3 \ && curl --fail --show-error --location --output dotnet-monitor-base.tar.gz https://ci.dot.net/public/diagnostics/monitor/8.1.3-servicing.25556.1/dotnet-monitor-base-$dotnet_monitor_version-linux-x64.tar.gz \ && dotnet_monitor_base_sha512='34d06efdbde4e7fb3606b5fddd7bb80ea70396fc1490ce416cbdd2e78c4393a8b3407ec1f28c0a620ebab779a2765b4f76d78ea7a96212d62597dd5e6bac9da0' \ && echo "$dotnet_monitor_base_sha512 dotnet-monitor-base.tar.gz" | sha512sum -c - \ && mkdir --parents /app \ && tar --gzip --extract --no-same-owner --file dotnet-monitor-base.tar.gz --directory /app \ && rm dotnet-monitor-base.tar.gz # .NET Monitor Base image FROM $REPO:8.0.30-jammy-chiseled-amd64 WORKDIR /app COPY --from=installer /app . ENV \ # Unset ASPNETCORE_HTTP_PORTS from aspnet base image ASPNETCORE_HTTP_PORTS= \ # Disable debugger and profiler diagnostics to avoid diagnosing self. COMPlus_EnableDiagnostics=0 \ # Default Filter DefaultProcess__Filters__0__Key=ProcessId \ DefaultProcess__Filters__0__Value=1 \ # Remove Unix Domain Socket before starting diagnostic port server DiagnosticPort__DeleteEndpointOnStartup=true \ # Server GC mode DOTNET_gcServer=1 \ # Logging: JSON format so that analytic platforms can get discrete entry information Logging__Console__FormatterName=json \ # Logging: Use round-trip date/time format without timezone information (always logged in UTC) Logging__Console__FormatterOptions__TimestampFormat=yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffff'Z' \ # Logging: Write timestamps using UTC offset (+0:00) Logging__Console__FormatterOptions__UseUtcTimestamp=true \ # Add dotnet-monitor path to front of PATH for easier, prioritized execution PATH="/app:${PATH}" ENTRYPOINT [ "dotnet-monitor" ] CMD [ "collect", "--urls", "https://+:52323", "--metricUrls", "http://+:52325" ]