ARG REPO=mcr.microsoft.com/dotnet/core/aspnet FROM $REPO:5.0-alpine3.12 ENV \ # Unset ASPNETCORE_URLS from aspnet base image ASPNETCORE_URLS= \ DOTNET_SDK_VERSION=5.0.100-preview.6.20318.15 \ # Disable the invariant mode (set in base image) DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false \ # 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-DotnetCoreSDK-Alpine-3.12 RUN apk add --no-cache \ curl \ icu-libs \ git # Install .NET Core SDK RUN wget -O dotnet.tar.gz https://dotnetcli.azureedge.net/dotnet/Sdk/$DOTNET_SDK_VERSION/dotnet-sdk-$DOTNET_SDK_VERSION-linux-musl-x64.tar.gz \ && dotnet_sha512='e0c5283cd1758f921e25f4653c8c8a3076dd83602c8f036b347450695717ad3c071222b2467df27b8854c55e555f4ed095f9dc072d595caf6fe7b4abde6332d5' \ && echo "$dotnet_sha512 dotnet.tar.gz" | sha512sum -c - \ && mkdir -p /usr/share/dotnet \ && tar -C /usr/share/dotnet -oxzf dotnet.tar.gz ./packs ./sdk ./templates ./LICENSE.txt ./ThirdPartyNotices.txt \ && rm dotnet.tar.gz \ # Trigger first run experience by running arbitrary cmd && dotnet help # Install PowerShell global tool RUN powershell_version=7.1.0-preview.4 \ && wget -O PowerShell.Linux.Alpine.$powershell_version.nupkg https://pwshtool.blob.core.windows.net/tool/$powershell_version/PowerShell.Linux.Alpine.$powershell_version.nupkg \ && powershell_sha512='eaf539bafd14548a23045568deb55290061a5cfcf2e0d3c2827c1acaa71c3225b78f4ed49db07dfb6b351047967faa685813b1d51eb1ca62eea1d9e93c79b379' \ && echo "$powershell_sha512 PowerShell.Linux.Alpine.$powershell_version.nupkg" | sha512sum -c - \ && mkdir -p /usr/share/powershell \ && dotnet tool install --add-source / --tool-path /usr/share/powershell --version $powershell_version PowerShell.Linux.Alpine \ && dotnet nuget locals all --clear \ && rm PowerShell.Linux.Alpine.$powershell_version.nupkg \ && chmod 755 /usr/share/powershell/pwsh \ && ln -s /usr/share/powershell/pwsh /usr/bin/pwsh \ # To reduce image size, remove the copy nupkg that nuget keeps. && find /usr/share/powershell -print | grep -i '.*[.]nupkg$' | xargs rm \ # Add ncurses-terminfo-base to resolve psreadline dependency && apk add --no-cache ncurses-terminfo-base