diff --git a/.gitignore b/.gitignore index 0fd70e1c23..496d51b39f 100644 --- a/.gitignore +++ b/.gitignore @@ -264,7 +264,6 @@ images/runtime/node/*/bullseye.Dockerfile images/runtime/dotnetcore/*/Dockerfile images/runtime/dotnetcore/*/buster.Dockerfile images/runtime/dotnetcore/*/stretch.Dockerfile -images/runtime/dotnetcore/*/*.staging.Dockerfile images/runtime/dotnetcore/*/bullseye.Dockerfile images/runtime/dotnetcore/*/bookworm.Dockerfile images/runtime/python/*/Dockerfile diff --git a/build/__dotNetCoreRunTimeVersions.sh b/build/__dotNetCoreRunTimeVersions.sh index a1f656cdee..08aaa6f8eb 100644 --- a/build/__dotNetCoreRunTimeVersions.sh +++ b/build/__dotNetCoreRunTimeVersions.sh @@ -1,6 +1,6 @@ # This file was auto-generated from 'constants.yaml'. Changes may be overridden. -DOT_NET_CORE_RUNTIME_BASE_TAG='20231026.1' +DOT_NET_CORE_RUNTIME_BASE_TAG='20231108.3' NET_CORE_APP_10='1.0.16' NET_CORE_APP_11='1.1.13' NET_CORE_APP_20='2.0.9' diff --git a/build/__stagingRuntimeConstants.sh b/build/__stagingRuntimeConstants.sh index 6d20cc82e3..5d69cc3c6c 100644 --- a/build/__stagingRuntimeConstants.sh +++ b/build/__stagingRuntimeConstants.sh @@ -1,6 +1,6 @@ # This file was auto-generated from 'constants.yaml'. Changes may be overridden. -DOTNETCORE_STAGING_RUNTIME_VERSIONS=("") +DOTNETCORE_STAGING_RUNTIME_VERSIONS=("8.0") PYTHON_STAGING_RUNTIME_VERSIONS=("") NODE_STAGING_RUNTIME_VERSIONS=("") JAVA_STAGING_RUNTIME_VERSIONS=("") diff --git a/build/constants.yaml b/build/constants.yaml index 3625f7c419..b9d4fea278 100644 --- a/build/constants.yaml +++ b/build/constants.yaml @@ -69,7 +69,7 @@ file-name-prefix: __ - name: dot-net-core-run-time-versions constants: - dot-net-core-runtime-base-tag: 20231026.1 + dot-net-core-runtime-base-tag: 20231108.3 net-core-app-10: 1.0.16 net-core-app-11: 1.1.13 net-core-app-20: 2.0.9 @@ -477,7 +477,7 @@ - name: staging-runtime-constants constants: dotnetcore-staging-runtime-versions: - - + - 8.0 python-staging-runtime-versions: - node-staging-runtime-versions: diff --git a/images/runtime/dotnetcore/8.0/base.bookworm.staging.Dockerfile b/images/runtime/dotnetcore/8.0/base.bookworm.staging.Dockerfile new file mode 100644 index 0000000000..dd3002cd83 --- /dev/null +++ b/images/runtime/dotnetcore/8.0/base.bookworm.staging.Dockerfile @@ -0,0 +1,66 @@ +# dotnet tools are currently available as part of SDK so we need to create them in an sdk image +# and copy them to our final runtime image +FROM mcr.microsoft.com/dotnet/sdk:8.0-preview AS tools-install +RUN dotnet tool install --tool-path /dotnetcore-tools dotnet-sos +RUN dotnet tool install --tool-path /dotnetcore-tools dotnet-trace +RUN dotnet tool install --tool-path /dotnetcore-tools dotnet-dump +RUN dotnet tool install --tool-path /dotnetcore-tools dotnet-counters +RUN dotnet tool install --tool-path /dotnetcore-tools dotnet-gcdump +# Update dotnet-monitor after .NET is out of preview to: +# dotnet-monitor --version 8.* +RUN dotnet tool install --tool-path /dotnetcore-tools dotnet-monitor --version 8.0.0-preview.7.23402 + +FROM mcr.microsoft.com/mirror/docker/library/debian:bookworm-slim +ARG BUILD_DIR=/tmp/oryx/build +ADD build ${BUILD_DIR} + +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + # .NET Core dependencies + libc6 \ + libgcc1 \ + libgssapi-krb5-2 \ + libicu72 \ + libssl3 \ + libstdc++6 \ + zlib1g \ + lldb \ + curl \ + file \ + libgdiplus \ + && apt-get upgrade --assume-yes \ + && rm -rf /var/lib/apt/lists/* + +# Configure web servers to bind to port 80 when present +ENV ASPNETCORE_URLS=http://+:80 \ + # Enable detection of running in a container + DOTNET_RUNNING_IN_CONTAINER=true \ + PATH="/opt/dotnetcore-tools:${PATH}" + +COPY --from=tools-install /dotnetcore-tools /opt/dotnetcore-tools + +# Install .NET Core +# mount the secret sas token to pull the binaries, and make sure we do not print to docker build logs +RUN --mount=type=secret,id=dotnet_storage_account_token_id \ + set -e \ +# based on resolution on https://github.com/NuGet/Announcements/issues/49#issue-795386700 + && apt-get remove ca-certificates -y \ + && apt-get purge ca-certificates -y \ + && apt-get update \ + && apt-get install -f ca-certificates -y --no-install-recommends \ + && . ${BUILD_DIR}/__dotNetCoreRunTimeVersions.sh \ + && curl -SL --output dotnet.tar.gz https://dotnetcli.azureedge.net/dotnet/Runtime/$NET_CORE_APP_80/dotnet-runtime-$NET_CORE_APP_80-linux-x64.tar.gz \ + && echo "$NET_CORE_APP_80_SHA dotnet.tar.gz" | sha512sum -c - \ + && mkdir -p /usr/share/dotnet \ + && tar -zxf dotnet.tar.gz -C /usr/share/dotnet \ + && rm dotnet.tar.gz \ + && ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet \ + # Install ASP.NET Core + && . ${BUILD_DIR}/__dotNetCoreRunTimeVersions.sh \ + && curl -SL --output aspnetcore.tar.gz https://dotnetcli.azureedge.net/dotnet/aspnetcore/Runtime/$ASPNET_CORE_APP_80/aspnetcore-runtime-$ASPNET_CORE_APP_80-linux-x64.tar.gz \ + && echo "$ASPNET_CORE_APP_80_SHA aspnetcore.tar.gz" | sha512sum -c - \ + && mkdir -p /usr/share/dotnet \ + && tar -zxf aspnetcore.tar.gz -C /usr/share/dotnet ./shared/Microsoft.AspNetCore.App \ + && rm aspnetcore.tar.gz \ + && dotnet-sos install \ + && rm -rf ${BUILD_DIR} diff --git a/images/runtime/dotnetcore/8.0/base.bullseye.staging.Dockerfile b/images/runtime/dotnetcore/8.0/base.bullseye.staging.Dockerfile new file mode 100644 index 0000000000..1db1953e6c --- /dev/null +++ b/images/runtime/dotnetcore/8.0/base.bullseye.staging.Dockerfile @@ -0,0 +1,65 @@ +# dotnet tools are currently available as part of SDK so we need to create them in an sdk image +# and copy them to our final runtime image +FROM mcr.microsoft.com/dotnet/sdk:8.0-preview AS tools-install +RUN dotnet tool install --tool-path /dotnetcore-tools dotnet-sos +RUN dotnet tool install --tool-path /dotnetcore-tools dotnet-trace +RUN dotnet tool install --tool-path /dotnetcore-tools dotnet-dump +RUN dotnet tool install --tool-path /dotnetcore-tools dotnet-counters +RUN dotnet tool install --tool-path /dotnetcore-tools dotnet-gcdump +# Update dotnet-monitor after .NET is out of preview to: +# dotnet-monitor --version 8.* +RUN dotnet tool install --tool-path /dotnetcore-tools dotnet-monitor --version 8.0.0-preview.7.23402 +FROM mcr.microsoft.com/mirror/docker/library/debian:bullseye-slim +ARG BUILD_DIR=/tmp/oryx/build +ADD build ${BUILD_DIR} + +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + # .NET Core dependencies + libc6 \ + libgcc1 \ + libgssapi-krb5-2 \ + libicu67 \ + libssl1.1 \ + libstdc++6 \ + zlib1g \ + lldb \ + curl \ + file \ + libgdiplus \ + && apt-get upgrade --assume-yes \ + && rm -rf /var/lib/apt/lists/* + +# Configure web servers to bind to port 80 when present +ENV ASPNETCORE_URLS=http://+:80 \ + # Enable detection of running in a container + DOTNET_RUNNING_IN_CONTAINER=true \ + PATH="/opt/dotnetcore-tools:${PATH}" + +COPY --from=tools-install /dotnetcore-tools /opt/dotnetcore-tools + +# Install .NET Core +# mount the secret sas token to pull the binaries, and make sure we do not print to docker build logs +RUN --mount=type=secret,id=dotnet_storage_account_token_id \ + set -e \ +# based on resolution on https://github.com/NuGet/Announcements/issues/49#issue-795386700 + && apt-get remove ca-certificates -y \ + && apt-get purge ca-certificates -y \ + && apt-get update \ + && apt-get install -f ca-certificates -y --no-install-recommends \ + && . ${BUILD_DIR}/__dotNetCoreRunTimeVersions.sh \ + && curl -SL --output dotnet.tar.gz https://dotnetcli.azureedge.net/dotnet/Runtime/$NET_CORE_APP_80/dotnet-runtime-$NET_CORE_APP_80-linux-x64.tar.gz \ + && echo "$NET_CORE_APP_80_SHA dotnet.tar.gz" | sha512sum -c - \ + && mkdir -p /usr/share/dotnet \ + && tar -zxf dotnet.tar.gz -C /usr/share/dotnet \ + && rm dotnet.tar.gz \ + && ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet \ + # Install ASP.NET Core + && . ${BUILD_DIR}/__dotNetCoreRunTimeVersions.sh \ + && curl -SL --output aspnetcore.tar.gz https://dotnetcli.azureedge.net/dotnet/aspnetcore/Runtime/$ASPNET_CORE_APP_80/aspnetcore-runtime-$ASPNET_CORE_APP_80-linux-x64.tar.gz \ + && echo "$ASPNET_CORE_APP_80_SHA aspnetcore.tar.gz" | sha512sum -c - \ + && mkdir -p /usr/share/dotnet \ + && tar -zxf aspnetcore.tar.gz -C /usr/share/dotnet ./shared/Microsoft.AspNetCore.App \ + && rm aspnetcore.tar.gz \ + && dotnet-sos install \ + && rm -rf ${BUILD_DIR} diff --git a/src/BuildScriptGenerator/DotNetCore/DotNetCoreRunTimeVersions.cs b/src/BuildScriptGenerator/DotNetCore/DotNetCoreRunTimeVersions.cs index e6a30ff1a9..407c9c5a50 100644 --- a/src/BuildScriptGenerator/DotNetCore/DotNetCoreRunTimeVersions.cs +++ b/src/BuildScriptGenerator/DotNetCore/DotNetCoreRunTimeVersions.cs @@ -4,7 +4,7 @@ namespace Microsoft.Oryx.BuildScriptGenerator.DotNetCore { public static class DotNetCoreRunTimeVersions { - public const string DotNetCoreRuntimeBaseTag = "20231026.1"; + public const string DotNetCoreRuntimeBaseTag = "20231108.3"; public const string NetCoreApp10 = "1.0.16"; public const string NetCoreApp11 = "1.1.13"; public const string NetCoreApp20 = "2.0.9"; diff --git a/src/BuildScriptGenerator/StagingRuntimeConstants.cs b/src/BuildScriptGenerator/StagingRuntimeConstants.cs index b45899aae6..ee986602a8 100644 --- a/src/BuildScriptGenerator/StagingRuntimeConstants.cs +++ b/src/BuildScriptGenerator/StagingRuntimeConstants.cs @@ -6,7 +6,7 @@ namespace Microsoft.Oryx.BuildScriptGenerator.Common { public static class StagingRuntimeConstants { - public static readonly List DotnetcoreStagingRuntimeVersions = new List { }; + public static readonly List DotnetcoreStagingRuntimeVersions = new List { "8.0" }; public static readonly List PythonStagingRuntimeVersions = new List { }; public static readonly List NodeStagingRuntimeVersions = new List { }; public static readonly List JavaStagingRuntimeVersions = new List { };