Skip to content

Commit

Permalink
Williamhe/update dotnet 8 runtime (#2245)
Browse files Browse the repository at this point in the history
* Update dotnet8 sdk versions

* Update dotnet monitor version

* Add staging dockerfiles

* Add new .NET8 SDKs

* Add new .NET8 SDKs

* Updates for testing staging

* Update dotnet-monitor versions

* Add download url for new .net8 sdks

* Remove .net8 sdks

* Update supported platform version

* Update sdk versions

* Revert "Update sdk versions"

This reverts commit 874cffa.

* Update runtime tag

* Update dotnet-monitor version

* Add token parameter

* Revert "Add token parameter"

This reverts commit 5db274a.

* Revert "Update dotnet-monitor version"

This reverts commit 30a4815.
  • Loading branch information
william-msft authored Nov 9, 2023
1 parent e27125b commit 97e1254
Show file tree
Hide file tree
Showing 8 changed files with 137 additions and 7 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion build/__dotNetCoreRunTimeVersions.sh
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
2 changes: 1 addition & 1 deletion build/__stagingRuntimeConstants.sh
Original file line number Diff line number Diff line change
@@ -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=("")
Expand Down
4 changes: 2 additions & 2 deletions build/constants.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -477,7 +477,7 @@
- name: staging-runtime-constants
constants:
dotnetcore-staging-runtime-versions:
-
- 8.0
python-staging-runtime-versions:
-
node-staging-runtime-versions:
Expand Down
66 changes: 66 additions & 0 deletions images/runtime/dotnetcore/8.0/base.bookworm.staging.Dockerfile
Original file line number Diff line number Diff line change
@@ -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}
65 changes: 65 additions & 0 deletions images/runtime/dotnetcore/8.0/base.bullseye.staging.Dockerfile
Original file line number Diff line number Diff line change
@@ -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}
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion src/BuildScriptGenerator/StagingRuntimeConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Microsoft.Oryx.BuildScriptGenerator.Common
{
public static class StagingRuntimeConstants
{
public static readonly List<string> DotnetcoreStagingRuntimeVersions = new List<string> { };
public static readonly List<string> DotnetcoreStagingRuntimeVersions = new List<string> { "8.0" };
public static readonly List<string> PythonStagingRuntimeVersions = new List<string> { };
public static readonly List<string> NodeStagingRuntimeVersions = new List<string> { };
public static readonly List<string> JavaStagingRuntimeVersions = new List<string> { };
Expand Down

0 comments on commit 97e1254

Please sign in to comment.