ARG REPO=mcr.microsoft.com/dotnet/aspnet # Installer image FROM amd64/buildpack-deps:resolute-curl AS installer # Install .NET SDK RUN dotnet_sdk_version=10.0.400 \ && curl --fail --show-error --location \ --remote-name https://builds.dotnet.microsoft.com/dotnet/Sdk/$dotnet_sdk_version/dotnet-sdk-$dotnet_sdk_version-linux-x64.tar.gz \ --remote-name https://builds.dotnet.microsoft.com/dotnet/Sdk/$dotnet_sdk_version/dotnet-sdk-$dotnet_sdk_version-linux-x64.tar.gz.sha512 \ && sha512sum -c dotnet-sdk-$dotnet_sdk_version-linux-x64.tar.gz.sha512 \ && mkdir --parents /dotnet \ && tar --gzip --extract --no-same-owner --file dotnet-sdk-$dotnet_sdk_version-linux-x64.tar.gz --directory /dotnet ./dnx ./packs ./sdk ./sdk-manifests ./templates ./LICENSE.txt ./ThirdPartyNotices.txt \ && rm \ dotnet-sdk-$dotnet_sdk_version-linux-x64.tar.gz \ dotnet-sdk-$dotnet_sdk_version-linux-x64.tar.gz.sha512 # .NET SDK image FROM $REPO:10.0.11-resolute-amd64 ENV \ # Do not generate certificate DOTNET_GENERATE_ASPNET_CERTIFICATE=false \ # Do not show first run text DOTNET_NOLOGO=true \ # SDK version DOTNET_SDK_VERSION=10.0.400 \ # Enable correct mode for dotnet watch (only mode supported in a container) DOTNET_USE_POLLING_FILE_WATCHER=true \ # Skip extraction of XML docs - generally not useful within an image/container - helps performance NUGET_XMLDOC_MODE=skip \ # PowerShell telemetry for docker image usage POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-DotnetSDK-Ubuntu-26.04 RUN apt-get update \ && apt-get install -y --no-install-recommends \ curl \ git \ libatomic1 \ wget \ && rm -rf /var/lib/apt/lists/* COPY --from=installer ["/dotnet", "/usr/share/dotnet"] RUN ln -s /usr/share/dotnet/dnx /usr/bin/dnx \ # Trigger first run experience by running arbitrary cmd && dotnet help # Install PowerShell global tool RUN powershell_version=7.6.4 \ && curl --fail --show-error --location --output PowerShell.Linux.x64.$powershell_version.nupkg https://powershellinfraartifacts-gkhedzdeaghdezhr.z01.azurefd.net/tool/$powershell_version/PowerShell.Linux.x64.$powershell_version.nupkg \ && powershell_sha512='8d0a9d04ff5896824fa158c3c6e28da5af7f0305ec7c3358faa21b5681b026fdca4da52f9f6172c315fa2b964a0f75acd8ae7a8237ab597f7d98ed95422a688e' \ && echo "$powershell_sha512 PowerShell.Linux.x64.$powershell_version.nupkg" | sha512sum -c - \ && mkdir --parents /usr/share/powershell \ && dotnet tool install --add-source / --tool-path /usr/share/powershell --version $powershell_version PowerShell.Linux.x64 \ && dotnet nuget locals all --clear \ && rm PowerShell.Linux.x64.$powershell_version.nupkg \ && ln -s /usr/share/powershell/pwsh /usr/bin/pwsh \ && chmod 755 /usr/share/powershell/pwsh \ && chmod 755 /usr/share/powershell/.store/powershell.linux.x64/$powershell_version/powershell.linux.x64/$powershell_version/tools/*/any/pwsh \ # To reduce image size, remove the copy nupkg that nuget keeps. && find /usr/share/powershell -print | grep -i '.*[.]nupkg$' | xargs rm