From a69991f52466b255d80225809a974f27e1f6b2e3 Mon Sep 17 00:00:00 2001 From: Wali Bhuiyan Date: Thu, 5 Oct 2023 15:30:28 -0400 Subject: [PATCH 1/8] added dockerfiles to release baseImages in staging MCR account --- build/constants.yaml | 4 +- .../6.0/base.buster.staging.Dockerfile | 67 +++++++++++++++++++ .../7.0/base.buster.staging.Dockerfile | 67 +++++++++++++++++++ .../8.0/base.bookworm.staging.Dockerfile | 67 +++++++++++++++++++ 4 files changed, 204 insertions(+), 1 deletion(-) create mode 100644 images/runtime/dotnetcore/6.0/base.buster.staging.Dockerfile create mode 100644 images/runtime/dotnetcore/7.0/base.buster.staging.Dockerfile create mode 100644 images/runtime/dotnetcore/8.0/base.bookworm.staging.Dockerfile diff --git a/build/constants.yaml b/build/constants.yaml index 88225c7b26..960278638f 100644 --- a/build/constants.yaml +++ b/build/constants.yaml @@ -473,7 +473,9 @@ - name: staging-runtime-constants constants: dotnetcore-staging-runtime-versions: - - + - 6.0 + - 7.0 + - 8.0 python-staging-runtime-versions: - node-staging-runtime-versions: diff --git a/images/runtime/dotnetcore/6.0/base.buster.staging.Dockerfile b/images/runtime/dotnetcore/6.0/base.buster.staging.Dockerfile new file mode 100644 index 0000000000..7765fd02b2 --- /dev/null +++ b/images/runtime/dotnetcore/6.0/base.buster.staging.Dockerfile @@ -0,0 +1,67 @@ +# syntax=docker/dockerfile:1.3 +# the above line allows this dockerfile to use the secrets fucntionality + +# 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:6.0 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 +RUN dotnet tool install --tool-path /dotnetcore-tools dotnet-monitor --version 6.* + +FROM mcr.microsoft.com/mirror/docker/library/debian:buster-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 \ + libicu63 \ + 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=20200601~deb10u2 -y --no-install-recommends \ + && . ${BUILD_DIR}/__dotNetCoreRunTimeVersions.sh \ + && curl -SL --output dotnet.tar.gz https://dotnetcli.azureedge.net/dotnet/Runtime/$NET_CORE_APP_60/dotnet-runtime-$NET_CORE_APP_60-linux-x64.tar.gz \ + && echo "$NET_CORE_APP_60_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_60/aspnetcore-runtime-$ASPNET_CORE_APP_60-linux-x64.tar.gz \ + && echo "$ASPNET_CORE_APP_60_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} \ No newline at end of file diff --git a/images/runtime/dotnetcore/7.0/base.buster.staging.Dockerfile b/images/runtime/dotnetcore/7.0/base.buster.staging.Dockerfile new file mode 100644 index 0000000000..967004ad5a --- /dev/null +++ b/images/runtime/dotnetcore/7.0/base.buster.staging.Dockerfile @@ -0,0 +1,67 @@ +# syntax=docker/dockerfile:1.3 +# the above line allows this dockerfile to use the secrets fucntionality + +# 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:7.0 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 +RUN dotnet tool install --tool-path /dotnetcore-tools dotnet-monitor --version 6.* + +FROM mcr.microsoft.com/mirror/docker/library/debian:buster-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 \ + libicu63 \ + 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=20200601~deb10u2 -y --no-install-recommends \ + && . ${BUILD_DIR}/__dotNetCoreRunTimeVersions.sh \ + && curl -SL --output dotnet.tar.gz https://dotnetcli.azureedge.net/dotnet/Runtime/$NET_CORE_APP_70/dotnet-runtime-$NET_CORE_APP_70-linux-x64.tar.gz \ + && echo "$NET_CORE_APP_70_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_70/aspnetcore-runtime-$ASPNET_CORE_APP_70-linux-x64.tar.gz \ + && echo "$ASPNET_CORE_APP_70_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} \ No newline at end of file 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..16d5dc1eb4 --- /dev/null +++ b/images/runtime/dotnetcore/8.0/base.bookworm.staging.Dockerfile @@ -0,0 +1,67 @@ +# syntax=docker/dockerfile:1.3 +# the above line allows this dockerfile to use the secrets fucntionality + +# 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 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 +RUN dotnet tool install --tool-path /dotnetcore-tools dotnet-monitor --version 6.* + +FROM mcr.microsoft.com/mirror/docker/library/debian:buster-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 \ + libicu63 \ + 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=20200601~deb10u2 -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} \ No newline at end of file From cde2209830994c33600eb9e6658d2eba3c480710 Mon Sep 17 00:00:00 2001 From: Wali Bhuiyan Date: Thu, 5 Oct 2023 16:19:25 -0400 Subject: [PATCH 2/8] updated the constant files --- build/__stagingRuntimeConstants.sh | 2 +- src/BuildScriptGenerator/StagingRuntimeConstants.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/__stagingRuntimeConstants.sh b/build/__stagingRuntimeConstants.sh index 6d20cc82e3..35a57e93c7 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=("6.0" "7.0" "8.0") PYTHON_STAGING_RUNTIME_VERSIONS=("") NODE_STAGING_RUNTIME_VERSIONS=("") JAVA_STAGING_RUNTIME_VERSIONS=("") diff --git a/src/BuildScriptGenerator/StagingRuntimeConstants.cs b/src/BuildScriptGenerator/StagingRuntimeConstants.cs index b45899aae6..c020b60294 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 { "6.0", "7.0", "8.0" }; public static readonly List PythonStagingRuntimeVersions = new List { }; public static readonly List NodeStagingRuntimeVersions = new List { }; public static readonly List JavaStagingRuntimeVersions = new List { }; From fbba1a5bd0087e5d780c1e4b3d354c6c3911514c Mon Sep 17 00:00:00 2001 From: Wali Bhuiyan Date: Thu, 5 Oct 2023 21:13:13 -0400 Subject: [PATCH 3/8] updated the baseRuntimeImage tag --- build/__dotNetCoreRunTimeVersions.sh | 2 +- build/constants.yaml | 2 +- .../DotNetCore/DotNetCoreRunTimeVersions.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build/__dotNetCoreRunTimeVersions.sh b/build/__dotNetCoreRunTimeVersions.sh index d0290a23f0..dd71b6ec67 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='20230930.2' +DOT_NET_CORE_RUNTIME_BASE_TAG='20231005.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/constants.yaml b/build/constants.yaml index 960278638f..053cc7e87f 100644 --- a/build/constants.yaml +++ b/build/constants.yaml @@ -68,7 +68,7 @@ file-name-prefix: __ - name: dot-net-core-run-time-versions constants: - dot-net-core-runtime-base-tag: 20230930.2 + dot-net-core-runtime-base-tag: 20231005.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/src/BuildScriptGenerator/DotNetCore/DotNetCoreRunTimeVersions.cs b/src/BuildScriptGenerator/DotNetCore/DotNetCoreRunTimeVersions.cs index ed544db521..695b703732 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 = "20230930.2"; + public const string DotNetCoreRuntimeBaseTag = "20231005.3"; public const string NetCoreApp10 = "1.0.16"; public const string NetCoreApp11 = "1.1.13"; public const string NetCoreApp20 = "2.0.9"; From 8bdb512996c8a60ce16cc059ad132a47a067486c Mon Sep 17 00:00:00 2001 From: Wali Bhuiyan Date: Fri, 6 Oct 2023 02:27:11 -0400 Subject: [PATCH 4/8] temporary issue fix --- images/runtime/dotnetcore/generateDockerfiles.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/images/runtime/dotnetcore/generateDockerfiles.sh b/images/runtime/dotnetcore/generateDockerfiles.sh index f5be47c482..c07f39503c 100755 --- a/images/runtime/dotnetcore/generateDockerfiles.sh +++ b/images/runtime/dotnetcore/generateDockerfiles.sh @@ -54,7 +54,9 @@ do sed -i "s|$RUNTIME_BASE_IMAGE_TAG_PLACEHOLDER|$RUNTIME_BASE_IMAGE_TAG|g" "$TARGET_DOCKERFILE" sed -i "s|$DOTNET_VERSION_PLACEHOLDER|$VERSION_DIRECTORY|g" "$TARGET_DOCKERFILE" - if shouldStageRuntimeVersion "dotnetcore" $VERSION_DIRECTORY ; then + # Added the [ "$ImageDebianFlavor" != "bullseye" ] condition to avoid creating bullseye images from `staging/oryx` repo. + # This is a temporary change only to release the dotnet 6,7,8 privately. + if [ shouldStageRuntimeVersion "dotnetcore" $VERSION_DIRECTORY ] && [ "$ImageDebianFlavor" != "bullseye" ] ; then sed -i "s|$BASE_IMAGE_REPO_PLACEHOLDER|$BASE_IMAGES_STAGING_REPO|g" "$TARGET_DOCKERFILE" else sed -i "s|$BASE_IMAGE_REPO_PLACEHOLDER|mcr.microsoft.com/oryx/base|g" "$TARGET_DOCKERFILE" From 3072ce4294160347b44e84e2e5a9da66d5382623 Mon Sep 17 00:00:00 2001 From: Wali Bhuiyan Date: Fri, 6 Oct 2023 02:39:17 -0400 Subject: [PATCH 5/8] temporary fix to release dotnet 6,7, and 8 privately --- build/constants.yaml | 2 -- images/runtime/dotnetcore/generateDockerfiles.sh | 6 ++---- .../DotNetCore/DotNetCoreSdkVersions.cs | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/build/constants.yaml b/build/constants.yaml index 053cc7e87f..b74aed0360 100644 --- a/build/constants.yaml +++ b/build/constants.yaml @@ -53,9 +53,7 @@ - 3.1-debian-bullseye - 3.1-debian-buster - 5.0-debian-buster - - 6.0-debian-bullseye - 6.0-debian-buster - - 7.0-debian-bullseye - 7.0-debian-buster - 8.0-debian-bookworm - dynamic-debian-buster diff --git a/images/runtime/dotnetcore/generateDockerfiles.sh b/images/runtime/dotnetcore/generateDockerfiles.sh index c07f39503c..908eb2c2b1 100755 --- a/images/runtime/dotnetcore/generateDockerfiles.sh +++ b/images/runtime/dotnetcore/generateDockerfiles.sh @@ -24,7 +24,7 @@ declare -r DOTNET_VERSION_PLACEHOLDER="%DOTNET_VERSION%" # Please make sure that any changes to debian flavors supported here are also reflected in build/constants.yaml declare -r NETCORE_BOOKWORM_VERSION_ARRAY=($NET_CORE_APP_80) -declare -r NETCORE_BULLSEYE_VERSION_ARRAY=($NET_CORE_APP_31 $NET_CORE_APP_60 $NET_CORE_APP_70) +declare -r NETCORE_BULLSEYE_VERSION_ARRAY=($NET_CORE_APP_31) declare -r NETCORE_BUSTER_VERSION_ARRAY=($NET_CORE_APP_30 $NET_CORE_APP_31 $NET_CORE_APP_50 $NET_CORE_APP_60 $NET_CORE_APP_70) cd $DIR @@ -54,9 +54,7 @@ do sed -i "s|$RUNTIME_BASE_IMAGE_TAG_PLACEHOLDER|$RUNTIME_BASE_IMAGE_TAG|g" "$TARGET_DOCKERFILE" sed -i "s|$DOTNET_VERSION_PLACEHOLDER|$VERSION_DIRECTORY|g" "$TARGET_DOCKERFILE" - # Added the [ "$ImageDebianFlavor" != "bullseye" ] condition to avoid creating bullseye images from `staging/oryx` repo. - # This is a temporary change only to release the dotnet 6,7,8 privately. - if [ shouldStageRuntimeVersion "dotnetcore" $VERSION_DIRECTORY ] && [ "$ImageDebianFlavor" != "bullseye" ] ; then + if shouldStageRuntimeVersion "dotnetcore" $VERSION_DIRECTORY ; then sed -i "s|$BASE_IMAGE_REPO_PLACEHOLDER|$BASE_IMAGES_STAGING_REPO|g" "$TARGET_DOCKERFILE" else sed -i "s|$BASE_IMAGE_REPO_PLACEHOLDER|mcr.microsoft.com/oryx/base|g" "$TARGET_DOCKERFILE" diff --git a/src/BuildScriptGenerator/DotNetCore/DotNetCoreSdkVersions.cs b/src/BuildScriptGenerator/DotNetCore/DotNetCoreSdkVersions.cs index 9d17d9e32c..765cc44751 100644 --- a/src/BuildScriptGenerator/DotNetCore/DotNetCoreSdkVersions.cs +++ b/src/BuildScriptGenerator/DotNetCore/DotNetCoreSdkVersions.cs @@ -17,6 +17,6 @@ public static class DotNetCoreSdkVersions public const string DotNet60RtmSdkVersion = "6-0-100-rtm-21527-11"; public const string DotNet70SdkVersion = "7.0.306"; public const string DotNet80SdkVersion = "8.0.100-rc.1.23463.5"; - public static readonly List RuntimeVersions = new List { "3.0-debian-buster", "3.1-debian-bullseye", "3.1-debian-buster", "5.0-debian-buster", "6.0-debian-bullseye", "6.0-debian-buster", "7.0-debian-bullseye", "7.0-debian-buster", "8.0-debian-bookworm", "dynamic-debian-buster" }; + public static readonly List RuntimeVersions = new List { "3.0-debian-buster", "3.1-debian-bullseye", "3.1-debian-buster", "5.0-debian-buster", "6.0-debian-buster", "7.0-debian-buster", "8.0-debian-bookworm", "dynamic-debian-buster" }; } } \ No newline at end of file From 3a0f75450b60326c1a0aea4cf3993016d5915ec8 Mon Sep 17 00:00:00 2001 From: Wali Bhuiyan Date: Fri, 6 Oct 2023 03:50:59 -0400 Subject: [PATCH 6/8] issue fix --- build/constants.yaml | 2 ++ src/BuildScriptGenerator/DotNetCore/DotNetCoreSdkVersions.cs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/build/constants.yaml b/build/constants.yaml index b74aed0360..053cc7e87f 100644 --- a/build/constants.yaml +++ b/build/constants.yaml @@ -53,7 +53,9 @@ - 3.1-debian-bullseye - 3.1-debian-buster - 5.0-debian-buster + - 6.0-debian-bullseye - 6.0-debian-buster + - 7.0-debian-bullseye - 7.0-debian-buster - 8.0-debian-bookworm - dynamic-debian-buster diff --git a/src/BuildScriptGenerator/DotNetCore/DotNetCoreSdkVersions.cs b/src/BuildScriptGenerator/DotNetCore/DotNetCoreSdkVersions.cs index 765cc44751..9d17d9e32c 100644 --- a/src/BuildScriptGenerator/DotNetCore/DotNetCoreSdkVersions.cs +++ b/src/BuildScriptGenerator/DotNetCore/DotNetCoreSdkVersions.cs @@ -17,6 +17,6 @@ public static class DotNetCoreSdkVersions public const string DotNet60RtmSdkVersion = "6-0-100-rtm-21527-11"; public const string DotNet70SdkVersion = "7.0.306"; public const string DotNet80SdkVersion = "8.0.100-rc.1.23463.5"; - public static readonly List RuntimeVersions = new List { "3.0-debian-buster", "3.1-debian-bullseye", "3.1-debian-buster", "5.0-debian-buster", "6.0-debian-buster", "7.0-debian-buster", "8.0-debian-bookworm", "dynamic-debian-buster" }; + public static readonly List RuntimeVersions = new List { "3.0-debian-buster", "3.1-debian-bullseye", "3.1-debian-buster", "5.0-debian-buster", "6.0-debian-bullseye", "6.0-debian-buster", "7.0-debian-bullseye", "7.0-debian-buster", "8.0-debian-bookworm", "dynamic-debian-buster" }; } } \ No newline at end of file From 00aee7c33358f40272510a1c876c94f4751fcda1 Mon Sep 17 00:00:00 2001 From: Wali Bhuiyan Date: Fri, 6 Oct 2023 10:33:01 -0400 Subject: [PATCH 7/8] added bullseye baseimage to release secretly --- .../6.0/base.bullseye.staging.Dockerfile | 67 +++++++++++++++++++ .../7.0/base.bullseye.staging.Dockerfile | 67 +++++++++++++++++++ .../runtime/dotnetcore/generateDockerfiles.sh | 2 +- 3 files changed, 135 insertions(+), 1 deletion(-) create mode 100644 images/runtime/dotnetcore/6.0/base.bullseye.staging.Dockerfile create mode 100644 images/runtime/dotnetcore/7.0/base.bullseye.staging.Dockerfile diff --git a/images/runtime/dotnetcore/6.0/base.bullseye.staging.Dockerfile b/images/runtime/dotnetcore/6.0/base.bullseye.staging.Dockerfile new file mode 100644 index 0000000000..7765fd02b2 --- /dev/null +++ b/images/runtime/dotnetcore/6.0/base.bullseye.staging.Dockerfile @@ -0,0 +1,67 @@ +# syntax=docker/dockerfile:1.3 +# the above line allows this dockerfile to use the secrets fucntionality + +# 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:6.0 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 +RUN dotnet tool install --tool-path /dotnetcore-tools dotnet-monitor --version 6.* + +FROM mcr.microsoft.com/mirror/docker/library/debian:buster-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 \ + libicu63 \ + 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=20200601~deb10u2 -y --no-install-recommends \ + && . ${BUILD_DIR}/__dotNetCoreRunTimeVersions.sh \ + && curl -SL --output dotnet.tar.gz https://dotnetcli.azureedge.net/dotnet/Runtime/$NET_CORE_APP_60/dotnet-runtime-$NET_CORE_APP_60-linux-x64.tar.gz \ + && echo "$NET_CORE_APP_60_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_60/aspnetcore-runtime-$ASPNET_CORE_APP_60-linux-x64.tar.gz \ + && echo "$ASPNET_CORE_APP_60_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} \ No newline at end of file diff --git a/images/runtime/dotnetcore/7.0/base.bullseye.staging.Dockerfile b/images/runtime/dotnetcore/7.0/base.bullseye.staging.Dockerfile new file mode 100644 index 0000000000..967004ad5a --- /dev/null +++ b/images/runtime/dotnetcore/7.0/base.bullseye.staging.Dockerfile @@ -0,0 +1,67 @@ +# syntax=docker/dockerfile:1.3 +# the above line allows this dockerfile to use the secrets fucntionality + +# 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:7.0 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 +RUN dotnet tool install --tool-path /dotnetcore-tools dotnet-monitor --version 6.* + +FROM mcr.microsoft.com/mirror/docker/library/debian:buster-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 \ + libicu63 \ + 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=20200601~deb10u2 -y --no-install-recommends \ + && . ${BUILD_DIR}/__dotNetCoreRunTimeVersions.sh \ + && curl -SL --output dotnet.tar.gz https://dotnetcli.azureedge.net/dotnet/Runtime/$NET_CORE_APP_70/dotnet-runtime-$NET_CORE_APP_70-linux-x64.tar.gz \ + && echo "$NET_CORE_APP_70_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_70/aspnetcore-runtime-$ASPNET_CORE_APP_70-linux-x64.tar.gz \ + && echo "$ASPNET_CORE_APP_70_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} \ No newline at end of file diff --git a/images/runtime/dotnetcore/generateDockerfiles.sh b/images/runtime/dotnetcore/generateDockerfiles.sh index 908eb2c2b1..f5be47c482 100755 --- a/images/runtime/dotnetcore/generateDockerfiles.sh +++ b/images/runtime/dotnetcore/generateDockerfiles.sh @@ -24,7 +24,7 @@ declare -r DOTNET_VERSION_PLACEHOLDER="%DOTNET_VERSION%" # Please make sure that any changes to debian flavors supported here are also reflected in build/constants.yaml declare -r NETCORE_BOOKWORM_VERSION_ARRAY=($NET_CORE_APP_80) -declare -r NETCORE_BULLSEYE_VERSION_ARRAY=($NET_CORE_APP_31) +declare -r NETCORE_BULLSEYE_VERSION_ARRAY=($NET_CORE_APP_31 $NET_CORE_APP_60 $NET_CORE_APP_70) declare -r NETCORE_BUSTER_VERSION_ARRAY=($NET_CORE_APP_30 $NET_CORE_APP_31 $NET_CORE_APP_50 $NET_CORE_APP_60 $NET_CORE_APP_70) cd $DIR From 8453d2ef4dd45080829a4e85aec4c83a8f02f95d Mon Sep 17 00:00:00 2001 From: Wali Bhuiyan Date: Fri, 6 Oct 2023 11:21:49 -0400 Subject: [PATCH 8/8] updated the base image tag --- build/__dotNetCoreRunTimeVersions.sh | 2 +- build/constants.yaml | 2 +- .../DotNetCore/DotNetCoreRunTimeVersions.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build/__dotNetCoreRunTimeVersions.sh b/build/__dotNetCoreRunTimeVersions.sh index dd71b6ec67..fb38b26c34 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='20231005.3' +DOT_NET_CORE_RUNTIME_BASE_TAG='20231006.1' 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/constants.yaml b/build/constants.yaml index 053cc7e87f..f29fb1c2cc 100644 --- a/build/constants.yaml +++ b/build/constants.yaml @@ -68,7 +68,7 @@ file-name-prefix: __ - name: dot-net-core-run-time-versions constants: - dot-net-core-runtime-base-tag: 20231005.3 + dot-net-core-runtime-base-tag: 20231006.1 net-core-app-10: 1.0.16 net-core-app-11: 1.1.13 net-core-app-20: 2.0.9 diff --git a/src/BuildScriptGenerator/DotNetCore/DotNetCoreRunTimeVersions.cs b/src/BuildScriptGenerator/DotNetCore/DotNetCoreRunTimeVersions.cs index 695b703732..06cb00aa72 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 = "20231005.3"; + public const string DotNetCoreRuntimeBaseTag = "20231006.1"; public const string NetCoreApp10 = "1.0.16"; public const string NetCoreApp11 = "1.1.13"; public const string NetCoreApp20 = "2.0.9";