Skip to content

feat: add .NET 10 preview Lambda container image #2087

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 40 additions & 2 deletions .github/workflows/update-Dockerfiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,20 @@ on:
description: ".NET 9 Next Version"
type: string
required: true
NET_10_AMD64:
description: ".NET 10 AMD64"
type: boolean
required: true
default: "true"
NET_10_ARM64:
description: ".NET 10 ARM64"
type: boolean
required: true
default: "true"
NET_10_NEXT_VERSION:
description: ".NET 10 Next Version"
type: string
required: true

jobs:
build:
Expand All @@ -41,6 +55,8 @@ jobs:
NET_8_ARM64_Dockerfile: "LambdaRuntimeDockerfiles/Images/net8/arm64/Dockerfile"
NET_9_AMD64_Dockerfile: "LambdaRuntimeDockerfiles/Images/net9/amd64/Dockerfile"
NET_9_ARM64_Dockerfile: "LambdaRuntimeDockerfiles/Images/net9/arm64/Dockerfile"
NET_10_AMD64_Dockerfile: "LambdaRuntimeDockerfiles/Images/net10/amd64/Dockerfile"
NET_10_ARM64_Dockerfile: "LambdaRuntimeDockerfiles/Images/net10/arm64/Dockerfile"

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand Down Expand Up @@ -89,6 +105,26 @@ jobs:
.\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion "${{ env.NEXT_VERSION }}"
if: ${{ github.event.inputs.NET_9_ARM64 == 'true' }}

- name: Update .NET 10 AMD64
id: update-net10-amd64
shell: pwsh
env:
DOCKERFILE_PATH: ${{ env.NET_10_AMD64_Dockerfile }}
NEXT_VERSION: ${{ github.event.inputs.NET_10_NEXT_VERSION }}
run: |
.\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion "${{ env.NEXT_VERSION }}"
if: ${{ github.event.inputs.NET_10_AMD64 == 'true' }}

- name: Update .NET 10 ARM64
id: update-net10-arm64
shell: pwsh
env:
DOCKERFILE_PATH: ${{ env.NET_10_ARM64_Dockerfile }}
NEXT_VERSION: ${{ github.event.inputs.NET_10_NEXT_VERSION }}
run: |
.\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion "${{ env.NEXT_VERSION }}"
if: ${{ github.event.inputs.NET_10_ARM64 == 'true' }}

# Update Dockerfiles if newer version of ASP.NET Core is available
- name: Commit and Push
id: commit-push
Expand Down Expand Up @@ -119,11 +155,13 @@ jobs:
\n\n*Description of changes:*
\n${{ format
(
'{0}\n{1}\n{2}\n{3}',
'{0}\n{1}\n{2}\n{3}\n{4}\n{5}',
join(steps.update-net8-amd64.outputs.MESSAGE, '\n'),
join(steps.update-net8-arm64.outputs.MESSAGE, '\n'),
join(steps.update-net9-amd64.outputs.MESSAGE, '\n'),
join(steps.update-net9-arm64.outputs.MESSAGE, '\n')
join(steps.update-net9-arm64.outputs.MESSAGE, '\n'),
join(steps.update-net10-amd64.outputs.MESSAGE, '\n'),
join(steps.update-net10-arm64.outputs.MESSAGE, '\n')
)
}}"
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
# Based on Docker image from: https://github.com/dotnet/dotnet-docker/

ARG ASPNET_VERSION=6.0.36
ARG ASPNET_SHA512=0e3d1dcc715bffbcb8ab8cb4fd72accbeed79ac40b7fd517961797a168f4301505044d2c1494a49b0e68103940bd6c178c8ae7bacf75f4b40ce82cc85624f6bd
ARG ASPNET_VERSION=10.0.0-preview.5.25277.114
ARG ASPNET_SHA512=6E69A85F7E18B8EEBB5F99A7E8099DB2FA5DA34BCF078BECBB123C0863D4BE7B4252C7CFC6B21B9585F4F800C058A12CAE55EF2A63B9BEA886CA3D1D8A0EC113

ARG LAMBDA_RUNTIME_NAME=dotnet6
ARG AMAZON_LINUX=public.ecr.aws/lambda/provided:al2
ARG LAMBDA_RUNTIME_NAME=dotnet10
ARG AMAZON_LINUX=public.ecr.aws/lambda/provided:al2023

FROM $AMAZON_LINUX AS base

FROM base AS builder-net6
RUN dnf install libicu-67.1-7.amzn2023.0.3.x86_64 --assumeyes

FROM base AS builder-net10
ARG ASPNET_VERSION
ARG ASPNET_SHA512

WORKDIR /dotnet

# Install tar and gzip for unarchiving downloaded tar.gz
RUN yum install tar gzip --assumeyes
RUN dnf install tar gzip --assumeyes

# Install the ASP.NET Core shared framework
RUN curl -SL --output aspnetcore.tar.gz https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/$ASPNET_VERSION/aspnetcore-runtime-$ASPNET_VERSION-linux-x64.tar.gz \
Expand All @@ -25,22 +27,24 @@ RUN curl -SL --output aspnetcore.tar.gz https://builds.dotnet.microsoft.com/dotn
&& rm aspnetcore.tar.gz


FROM mcr.microsoft.com/dotnet/sdk:6.0-bullseye-slim AS builder
FROM mcr.microsoft.com/dotnet/sdk:10.0-preview-trixie-slim AS builder
WORKDIR /src
COPY ["Libraries/src/Amazon.Lambda.RuntimeSupport", "Repo/Libraries/src/Amazon.Lambda.RuntimeSupport/"]
COPY ["Libraries/src/SnapshotRestore.Registry", "Repo/Libraries/src/SnapshotRestore.Registry/"]
COPY ["Libraries/src/Amazon.Lambda.Core", "Repo/Libraries/src/Amazon.Lambda.Core/"]
COPY ["buildtools/", "Repo/buildtools/"]
RUN dotnet restore "Repo/Libraries/src/Amazon.Lambda.RuntimeSupport/Amazon.Lambda.RuntimeSupport.csproj" /p:TargetFrameworks=net6.0
RUN dotnet restore "Repo/Libraries/src/Amazon.Lambda.RuntimeSupport/Amazon.Lambda.RuntimeSupport.csproj" /p:TargetFrameworks=net10.0
WORKDIR "Repo/Libraries/src/Amazon.Lambda.RuntimeSupport"
RUN dotnet build "Amazon.Lambda.RuntimeSupport.csproj" /p:ExecutableOutputType=true /p:GenerateDocumentationFile=false /p:TargetFrameworks=net6.0 --runtime linux-x64 -c Release -o /app/build
RUN dotnet build "Amazon.Lambda.RuntimeSupport.csproj" /p:ExecutableOutputType=true /p:GenerateDocumentationFile=false /p:TargetFrameworks=net10.0 --runtime linux-x64 -c Release -o /app/build


FROM builder AS publish
RUN dotnet publish "Amazon.Lambda.RuntimeSupport.csproj" /p:ExecutableOutputType=true /p:GenerateDocumentationFile=false /p:TargetFrameworks=net6.0 -f net6.0 --runtime linux-x64 --self-contained false -p:PublishReadyToRun=true -c Release -o /app/publish
RUN dotnet publish "Amazon.Lambda.RuntimeSupport.csproj" /p:ExecutableOutputType=true /p:GenerateDocumentationFile=false /p:TargetFrameworks=net10.0 -f net10.0 --runtime linux-x64 --self-contained false -p:PublishReadyToRun=true -c Release -o /app/publish
RUN apt-get update && apt-get install -y dos2unix
RUN dos2unix /app/publish/bootstrap.sh && \
mv /app/publish/bootstrap.sh /app/publish/bootstrap && \
chmod +x /app/publish/bootstrap
RUN touch /app/publish/empty-certificates.crt


FROM base
Expand All @@ -60,7 +64,7 @@ ENV \
# Disable Microsoft's telemetry collection
DOTNET_CLI_TELEMETRY_OPTOUT=true

COPY --from=builder-net6 /dotnet ${DOTNET_ROOT}
COPY --from=builder-net10 /dotnet ${DOTNET_ROOT}
COPY --from=publish /app/publish ${LAMBDA_RUNTIME_DIR}

# Generate runtime-release file
Expand Down
Original file line number Diff line number Diff line change
@@ -1,51 +1,23 @@
# Based on Docker image from: https://github.com/dotnet/dotnet-docker/

ARG ASPNET_VERSION=6.0.36
ARG ASPNET_SHA512=2a6a2dde7ba3aeee9145686ee32f1901a7aa6238ae8395ea3bad51770e227069272be83959b711d238210c377b66661e3cf039965f019b58cd44c08a982404a2
ARG ASPNET_VERSION=10.0.0-preview.5.25277.114
ARG ASPNET_SHA512=AC99EBEC4E7ABD660A27317D37DA56AE1FA8E9EBDBF4A88FE5F9BE58E1F4D7E8F05BEC32D5E902C0FDD1E9D9E250CDB49448266682010E4CF7F4640F9699B9F1

ARG ICU_VERSION=68.1
ARG ICU_MD5=6a99b541ea01f271257b121a4433c7c0

ARG LAMBDA_RUNTIME_NAME=dotnet6
ARG AMAZON_LINUX=public.ecr.aws/lambda/provided:al2
ARG LAMBDA_RUNTIME_NAME=dotnet10
ARG AMAZON_LINUX=public.ecr.aws/lambda/provided:al2023

FROM $AMAZON_LINUX AS base

FROM base AS builder-libicu
WORKDIR /

# Install depedencies to extract and build ICU library
RUN yum install -d1 -y \
tar \
gzip \
make \
gcc-c++

# Download, validate and extract ICU library
# https://github.com/unicode-org/icu/releases/tag/release-68-1
ARG ICU_VERSION
ARG ICU_MD5
RUN curl -SL https://github.com/unicode-org/icu/releases/download/release-${ICU_VERSION//./-}/icu4c-${ICU_VERSION//./_}-src.tgz -o icu-src.tgz \
&& echo "$ICU_MD5 icu-src.tgz" | md5sum -c - \
&& tar -xzf icu-src.tgz \
&& rm icu-src.tgz

# Build ICU library
RUN mkdir /libicu
WORKDIR /icu/source/
RUN ./configure --prefix=/libicu \
&& make \
&& make install


FROM base AS builder-net6
RUN dnf install libicu-67.1-7.amzn2023.0.3.aarch64 --assumeyes

FROM base AS builder-net10
ARG ASPNET_VERSION
ARG ASPNET_SHA512

WORKDIR /dotnet

# Install tar and gzip for unarchiving downloaded tar.gz
RUN yum install tar gzip --assumeyes
RUN dnf install tar gzip --assumeyes

# Install the ASP.NET Core shared framework
RUN curl -SL --output aspnetcore.tar.gz https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/$ASPNET_VERSION/aspnetcore-runtime-$ASPNET_VERSION-linux-arm64.tar.gz \
Expand All @@ -55,25 +27,24 @@ RUN curl -SL --output aspnetcore.tar.gz https://builds.dotnet.microsoft.com/dotn
&& rm aspnetcore.tar.gz


FROM mcr.microsoft.com/dotnet/sdk:6.0-bullseye-slim AS builder
FROM mcr.microsoft.com/dotnet/sdk:10.0-preview-trixie-slim AS builder
WORKDIR /src
COPY ["Libraries/src/Amazon.Lambda.RuntimeSupport", "Repo/Libraries/src/Amazon.Lambda.RuntimeSupport/"]
COPY ["Libraries/src/SnapshotRestore.Registry", "Repo/Libraries/src/SnapshotRestore.Registry/"]
COPY ["Libraries/src/Amazon.Lambda.Core", "Repo/Libraries/src/Amazon.Lambda.Core/"]
COPY ["buildtools/", "Repo/buildtools/"]
RUN dotnet restore "Repo/Libraries/src/Amazon.Lambda.RuntimeSupport/Amazon.Lambda.RuntimeSupport.csproj" /p:TargetFrameworks=net6.0
RUN dotnet restore "Repo/Libraries/src/Amazon.Lambda.RuntimeSupport/Amazon.Lambda.RuntimeSupport.csproj" /p:TargetFrameworks=net10.0
WORKDIR "Repo/Libraries/src/Amazon.Lambda.RuntimeSupport"
RUN dotnet build "Amazon.Lambda.RuntimeSupport.csproj" /p:ExecutableOutputType=true /p:GenerateDocumentationFile=false /p:TargetFrameworks=net6.0 --runtime linux-arm64 -c Release -o /app/build
RUN dotnet build "Amazon.Lambda.RuntimeSupport.csproj" /p:ExecutableOutputType=true /p:GenerateDocumentationFile=false /p:TargetFrameworks=net10.0 --runtime linux-arm64 -c Release -o /app/build


FROM builder AS publish
RUN dotnet publish "Amazon.Lambda.RuntimeSupport.csproj" /p:ExecutableOutputType=true /p:GenerateDocumentationFile=false /p:TargetFrameworks=net6.0 -f net6.0 --runtime linux-arm64 --self-contained false -p:PublishReadyToRun=true -c Release -o /app/publish
RUN dotnet publish "Amazon.Lambda.RuntimeSupport.csproj" /p:ExecutableOutputType=true /p:GenerateDocumentationFile=false /p:TargetFrameworks=net10.0 -f net10.0 --runtime linux-arm64 --self-contained false -p:PublishReadyToRun=true -c Release -o /app/publish
RUN apt-get update && apt-get install -y dos2unix
RUN dos2unix /app/publish/bootstrap.sh && \
mv /app/publish/bootstrap.sh /app/publish/bootstrap && \
chmod +x /app/publish/bootstrap

# Copy native dependencies
COPY --from=builder-libicu /libicu /app/publish
RUN touch /app/publish/empty-certificates.crt


FROM base
Expand All @@ -93,7 +64,7 @@ ENV \
# Disable Microsoft's telemetry collection
DOTNET_CLI_TELEMETRY_OPTOUT=true

COPY --from=builder-net6 /dotnet ${DOTNET_ROOT}
COPY --from=builder-net10 /dotnet ${DOTNET_ROOT}
COPY --from=publish /app/publish ${LAMBDA_RUNTIME_DIR}

# Generate runtime-release file
Expand Down
8 changes: 4 additions & 4 deletions LambdaRuntimeDockerfiles/Images/net8/amd64/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Based on Docker image from: https://github.com/dotnet/dotnet-docker/

ARG ASPNET_VERSION=8.0.16
ARG ASPNET_SHA512=0256cac4151acd6ffc82b0b7b6421f304817b6fdc2d9cb232018cf993e40da6b228d415397dd1b1b34859cffe1d8fc7bd7bb470df81128374e5c944a14c58360
ARG ASPNET_VERSION=8.0.17
ARG ASPNET_SHA512=b292dea52f70035bb7ccc82c1ed908fb084753eb08f662c7bb2e9206e22f396aa611db6573e827d5c5cff21590810b66eae0ead9b534bc3f8fc695f65f47f28f

ARG LAMBDA_RUNTIME_NAME=dotnet8
ARG AMAZON_LINUX=public.ecr.aws/lambda/provided:al2023
Expand Down Expand Up @@ -42,8 +42,8 @@ RUN dotnet build "Amazon.Lambda.RuntimeSupport.csproj" /p:ExecutableOutputType=t
FROM builder AS publish
RUN dotnet publish "Amazon.Lambda.RuntimeSupport.csproj" /p:ExecutableOutputType=true /p:GenerateDocumentationFile=false /p:TargetFrameworks=net8.0 -f net8.0 --runtime linux-x64 --self-contained false -p:PublishReadyToRun=true -c Release -o /app/publish
RUN apt-get update && apt-get install -y dos2unix
RUN dos2unix /app/publish/bootstrap-al2023.sh && \
mv /app/publish/bootstrap-al2023.sh /app/publish/bootstrap && \
RUN dos2unix /app/publish/bootstrap.net8.sh && \
mv /app/publish/bootstrap.net8.sh /app/publish/bootstrap && \
chmod +x /app/publish/bootstrap
RUN touch /app/publish/empty-certificates.crt

Expand Down
8 changes: 4 additions & 4 deletions LambdaRuntimeDockerfiles/Images/net8/arm64/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Based on Docker image from: https://github.com/dotnet/dotnet-docker/

ARG ASPNET_VERSION=8.0.16
ARG ASPNET_SHA512=a115e0e6253cea7e9a481ed82f57fc96413aa50ce7407932128cba153bdf4aec1bd8cdb9c04d290ff00f8544429feac86ba6e8d2b0f1674c255bd636c2c7e6de
ARG ASPNET_VERSION=8.0.17
ARG ASPNET_SHA512=4f1a441e400b60f814a161d2718c2599b4d492fffe5df5a5d8a494cec553ad3574c0988e9dc49abf8c928b9e9783a86f5506cbcbdf12d24e562090969aced3c5

ARG LAMBDA_RUNTIME_NAME=dotnet8
ARG AMAZON_LINUX=public.ecr.aws/lambda/provided:al2023
Expand Down Expand Up @@ -42,8 +42,8 @@ RUN dotnet build "Amazon.Lambda.RuntimeSupport.csproj" /p:ExecutableOutputType=t
FROM builder AS publish
RUN dotnet publish "Amazon.Lambda.RuntimeSupport.csproj" /p:ExecutableOutputType=true /p:GenerateDocumentationFile=false /p:TargetFrameworks=net8.0 -f net8.0 --runtime linux-arm64 --self-contained false -p:PublishReadyToRun=true -c Release -o /app/publish
RUN apt-get update && apt-get install -y dos2unix
RUN dos2unix /app/publish/bootstrap-al2023.sh && \
mv /app/publish/bootstrap-al2023.sh /app/publish/bootstrap && \
RUN dos2unix /app/publish/bootstrap.net8.sh && \
mv /app/publish/bootstrap.net8.sh /app/publish/bootstrap && \
chmod +x /app/publish/bootstrap
RUN touch /app/publish/empty-certificates.crt

Expand Down
8 changes: 4 additions & 4 deletions LambdaRuntimeDockerfiles/Images/net9/amd64/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Based on Docker image from: https://github.com/dotnet/dotnet-docker/

ARG ASPNET_VERSION=9.0.5
ARG ASPNET_SHA512=b60b8b5fa6b4538065166cd1266d075c64c464b281159d98bf03132bf363478ccc1185a9a51738cbe37d86752820f6be4add5208120a80dfb2bf4a8b58d22cc4
ARG ASPNET_VERSION=9.0.6
ARG ASPNET_SHA512=54c122c4c6127ce7e0f0ad0479a101db1455484c9e5bffa8fdc0dd72d2db028be86861f331f2c7c1cb2eaee9a92e741e4e5da567795533e46af27e4e481c0451

ARG LAMBDA_RUNTIME_NAME=dotnet9
ARG AMAZON_LINUX=public.ecr.aws/lambda/provided:al2023
Expand Down Expand Up @@ -41,8 +41,8 @@ RUN dotnet build "Amazon.Lambda.RuntimeSupport.csproj" /p:ExecutableOutputType=t
FROM builder AS publish
RUN dotnet publish "Amazon.Lambda.RuntimeSupport.csproj" /p:ExecutableOutputType=true /p:GenerateDocumentationFile=false /p:TargetFrameworks=net9.0 -f net9.0 --runtime linux-x64 --self-contained false -p:PublishReadyToRun=true -c Release -o /app/publish
RUN apt-get update && apt-get install -y dos2unix
RUN dos2unix /app/publish/bootstrap-al2023.sh && \
mv /app/publish/bootstrap-al2023.sh /app/publish/bootstrap && \
RUN dos2unix /app/publish/bootstrap.net8.sh && \
mv /app/publish/bootstrap.net8.sh /app/publish/bootstrap && \
chmod +x /app/publish/bootstrap
RUN touch /app/publish/empty-certificates.crt

Expand Down
8 changes: 4 additions & 4 deletions LambdaRuntimeDockerfiles/Images/net9/arm64/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Based on Docker image from: https://github.com/dotnet/dotnet-docker/

ARG ASPNET_VERSION=9.0.5
ARG ASPNET_SHA512=bd1db145a29b2eef440eba0491c5b70bf29e6793ebaab453d2939bd3ac161f7c33e3e4b1e65a734dd4fd44151357b4c150a4cfcb5ade7249cbf2d03266d6b32b
ARG ASPNET_VERSION=9.0.6
ARG ASPNET_SHA512=8a7024bd144254f400c0758efd5c39854eba5d7e3187fbde2dc857cedd9012ae93aceeb1683bf6bf390cefba40c50f95cc3295a1a8eb83133a8e01b91289dfc5

ARG LAMBDA_RUNTIME_NAME=dotnet9
ARG AMAZON_LINUX=public.ecr.aws/lambda/provided:al2023
Expand Down Expand Up @@ -41,8 +41,8 @@ RUN dotnet build "Amazon.Lambda.RuntimeSupport.csproj" /p:ExecutableOutputType=t
FROM builder AS publish
RUN dotnet publish "Amazon.Lambda.RuntimeSupport.csproj" /p:ExecutableOutputType=true /p:GenerateDocumentationFile=false /p:TargetFrameworks=net9.0 -f net9.0 --runtime linux-arm64 --self-contained false -p:PublishReadyToRun=true -c Release -o /app/publish
RUN apt-get update && apt-get install -y dos2unix
RUN dos2unix /app/publish/bootstrap-al2023.sh && \
mv /app/publish/bootstrap-al2023.sh /app/publish/bootstrap && \
RUN dos2unix /app/publish/bootstrap.net8.sh && \
mv /app/publish/bootstrap.net8.sh /app/publish/bootstrap && \
chmod +x /app/publish/bootstrap
RUN touch /app/publish/empty-certificates.crt

Expand Down
5 changes: 1 addition & 4 deletions LambdaRuntimeDockerfiles/Infrastructure/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ Infrastructure project allows to create pipeline to build and push .NET Lambda R
-GitHubRepoBranch "GitHubBranch" `
-StageEcr "AccountId.dkr.ecr.us-west-2.amazonaws.com" `
-BetaEcrs "AccountId.dkr.ecr.us-west-2.amazonaws.com;AccountId.dkr.ecr.us-west-2.amazonaws.com" `
-ProdEcrs "AccountId.dkr.ecr.us-west-2.amazonaws.com;AccountId.dkr.ecr.us-west-2.amazonaws.com" `
-EcrRepositoryName "awslambda/dotnet6.0-runtime;awslambda/dotnet8-runtime;awslambda/dotnet9-runtime" `
-TargetFramework "net6;net8;net9" `
-DotnetChannel "6.0;8.0;9.0"
-ProdEcrs "AccountId.dkr.ecr.us-west-2.amazonaws.com;AccountId.dkr.ecr.us-west-2.amazonaws.com"
```

#### Notes
Expand Down
Loading