diff --git a/.github/workflows/handle-stale-discussions.yml b/.github/workflows/handle-stale-discussions.yml index 8b5bcb1f8..534dc6584 100644 --- a/.github/workflows/handle-stale-discussions.yml +++ b/.github/workflows/handle-stale-discussions.yml @@ -13,6 +13,6 @@ jobs: discussions: write steps: - name: Stale discussions action - uses: aws-github-ops/handle-stale-discussions@v1 + uses: aws-github-ops/handle-stale-discussions@v1.6.0 env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/semgrep-analysis.yml b/.github/workflows/semgrep-analysis.yml index 2877d64a7..9703e3e52 100644 --- a/.github/workflows/semgrep-analysis.yml +++ b/.github/workflows/semgrep-analysis.yml @@ -35,7 +35,7 @@ jobs: p/owasp-top-ten - name: Upload SARIF file for GitHub Advanced Security Dashboard - uses: github/codeql-action/upload-sarif@ff0a06e83cb2de871e5a09832bc6a81e7276941f #v3.28.18 + uses: github/codeql-action/upload-sarif@fca7ace96b7d713c7035871441bd52efbe39e27e #v3.28.19 with: sarif_file: semgrep.sarif if: always() diff --git a/.github/workflows/update-Dockerfiles.yml b/.github/workflows/update-Dockerfiles.yml index 18141b8a2..9fbbd0690 100644 --- a/.github/workflows/update-Dockerfiles.yml +++ b/.github/workflows/update-Dockerfiles.yml @@ -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: @@ -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: @@ -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 @@ -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 }} diff --git a/LambdaRuntimeDockerfiles/Images/net6/amd64/Dockerfile b/LambdaRuntimeDockerfiles/Images/net10/amd64/Dockerfile similarity index 74% rename from LambdaRuntimeDockerfiles/Images/net6/amd64/Dockerfile rename to LambdaRuntimeDockerfiles/Images/net10/amd64/Dockerfile index 3d317c5e3..897d97f88 100644 --- a/LambdaRuntimeDockerfiles/Images/net6/amd64/Dockerfile +++ b/LambdaRuntimeDockerfiles/Images/net10/amd64/Dockerfile @@ -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 \ @@ -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 @@ -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 diff --git a/LambdaRuntimeDockerfiles/Images/net6/arm64/Dockerfile b/LambdaRuntimeDockerfiles/Images/net10/arm64/Dockerfile similarity index 63% rename from LambdaRuntimeDockerfiles/Images/net6/arm64/Dockerfile rename to LambdaRuntimeDockerfiles/Images/net10/arm64/Dockerfile index 2f7db39e3..846536c84 100644 --- a/LambdaRuntimeDockerfiles/Images/net6/arm64/Dockerfile +++ b/LambdaRuntimeDockerfiles/Images/net10/arm64/Dockerfile @@ -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 \ @@ -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 @@ -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 diff --git a/LambdaRuntimeDockerfiles/Images/net8/amd64/Dockerfile b/LambdaRuntimeDockerfiles/Images/net8/amd64/Dockerfile index 6bc96259e..7bae312b5 100644 --- a/LambdaRuntimeDockerfiles/Images/net8/amd64/Dockerfile +++ b/LambdaRuntimeDockerfiles/Images/net8/amd64/Dockerfile @@ -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 @@ -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 diff --git a/LambdaRuntimeDockerfiles/Images/net8/arm64/Dockerfile b/LambdaRuntimeDockerfiles/Images/net8/arm64/Dockerfile index a5ed4b6e4..8311e5f1c 100644 --- a/LambdaRuntimeDockerfiles/Images/net8/arm64/Dockerfile +++ b/LambdaRuntimeDockerfiles/Images/net8/arm64/Dockerfile @@ -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 @@ -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 diff --git a/LambdaRuntimeDockerfiles/Images/net9/amd64/Dockerfile b/LambdaRuntimeDockerfiles/Images/net9/amd64/Dockerfile index ff23897d5..63ede4b5b 100644 --- a/LambdaRuntimeDockerfiles/Images/net9/amd64/Dockerfile +++ b/LambdaRuntimeDockerfiles/Images/net9/amd64/Dockerfile @@ -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 @@ -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 diff --git a/LambdaRuntimeDockerfiles/Images/net9/arm64/Dockerfile b/LambdaRuntimeDockerfiles/Images/net9/arm64/Dockerfile index 03a107a6a..2d9630e83 100644 --- a/LambdaRuntimeDockerfiles/Images/net9/arm64/Dockerfile +++ b/LambdaRuntimeDockerfiles/Images/net9/arm64/Dockerfile @@ -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 @@ -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 diff --git a/LambdaRuntimeDockerfiles/Infrastructure/README.md b/LambdaRuntimeDockerfiles/Infrastructure/README.md index d9400adce..533b3e873 100644 --- a/LambdaRuntimeDockerfiles/Infrastructure/README.md +++ b/LambdaRuntimeDockerfiles/Infrastructure/README.md @@ -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 diff --git a/LambdaRuntimeDockerfiles/Infrastructure/src/Infrastructure/Configuration.cs b/LambdaRuntimeDockerfiles/Infrastructure/src/Infrastructure/Configuration.cs index 977de78c8..3a52fea23 100644 --- a/LambdaRuntimeDockerfiles/Infrastructure/src/Infrastructure/Configuration.cs +++ b/LambdaRuntimeDockerfiles/Infrastructure/src/Infrastructure/Configuration.cs @@ -30,19 +30,42 @@ internal class Configuration public string GitHubRepository { get; } = Environment.GetEnvironmentVariable("AWS_LAMBDA_GITHUB_REPO_NAME"); public string GitHubBranch { get; } = Environment.GetEnvironmentVariable("AWS_LAMBDA_GITHUB_REPO_BRANCH"); public Ecrs Ecrs { get; } = new Ecrs(); - public readonly string[] EcrRepositoryNames = Environment.GetEnvironmentVariable("AWS_LAMBDA_ECR_REPOSITORY_NAME")?.Split(";"); public const string ProjectRoot = "LambdaRuntimeDockerfiles/Infrastructure/src/Infrastructure"; - public static readonly string ProjectName = $"aws-lambda-container-images{Environment.GetEnvironmentVariable("AWS_LAMBDA_PIPELINE_NAME_SUFFIX")}"; - public readonly string[] DockerArm64Images = new string[] { "net6", "net8", "net9" }; - // DotnetSdkVersions is used to specify a specific version of the .NET SDK to be installed on the CodeBuild image - // The default behavior is to specify a channel and that installs the latest version in that channel - // By specifying a specific .NET SDK version, you override the default channel behavior - public readonly Dictionary DotnetSdkVersions = new Dictionary { }; - public readonly Dictionary DockerBuildImages = new Dictionary { {"net6", "6.0-bullseye-slim"}, {"net8", "8.0-bookworm-slim"}, {"net9", "9.0-bookworm-slim"} }; - public readonly Dictionary BaseImageAmd64Tags = new Dictionary { { "net6", "contributed-base-image-x86_64" }, { "net8", "contributed-base-image-x86_64" }, { "net9", "contributed-base-image-x86_64" } }; - public readonly Dictionary BaseImageArm64Tags = new Dictionary { { "net6", "contributed-base-image-arm64" }, { "net8", "contributed-base-image-arm64" }, { "net9", "contributed-base-image-arm64" } }; - public readonly string[] Frameworks = Environment.GetEnvironmentVariable("AWS_LAMBDA_DOTNET_FRAMEWORK_VERSION")?.Split(";"); - public readonly string[] Channels = Environment.GetEnvironmentVariable("AWS_LAMBDA_DOTNET_FRAMEWORK_CHANNEL")?.Split(";"); + public static readonly string ProjectName = "aws-lambda-container-images"; + + public readonly FrameworkConfiguration[] Frameworks = new[] + { + new FrameworkConfiguration + { + Framework = "net8", + Channel = "8.0", + EcrRepositoryName = "awslambda/dotnet8-runtime", + DockerBuildImage = "8.0-bookworm-slim", + BaseImageAmd64Tag = "contributed-base-image-x86_64", + BaseImageArm64Tag = "contributed-base-image-arm64", + HasArm64Image = true + }, + new FrameworkConfiguration + { + Framework = "net9", + Channel = "9.0", + EcrRepositoryName = "awslambda/dotnet9-runtime", + DockerBuildImage = "9.0-bookworm-slim", + BaseImageAmd64Tag = "contributed-base-image-x86_64", + BaseImageArm64Tag = "contributed-base-image-arm64", + HasArm64Image = true + }, + new FrameworkConfiguration + { + Framework = "net10", + Channel = "10.0", + EcrRepositoryName = "awslambda/dotnet10-runtime", + DockerBuildImage = "10.0-preview-trixie-slim", + BaseImageAmd64Tag = "contributed-base-image-x86_64", + BaseImageArm64Tag = "contributed-base-image-arm64", + HasArm64Image = true + } + }; } internal class Ecrs @@ -50,4 +73,26 @@ internal class Ecrs public string Stage { get; } = Environment.GetEnvironmentVariable("AWS_LAMBDA_STAGE_ECR"); public string Beta { get; } = Environment.GetEnvironmentVariable("AWS_LAMBDA_BETA_ECRS"); public string Prod { get; } = Environment.GetEnvironmentVariable("AWS_LAMBDA_PROD_ECRS"); -} \ No newline at end of file +} + +internal class FrameworkConfiguration +{ + public string Framework { get; set; } + + public string Channel { get; set; } + + public string EcrRepositoryName { get; set; } + + public string DockerBuildImage { get; set; } + + public string BaseImageAmd64Tag { get; set; } + + public string BaseImageArm64Tag { get; set; } + + public bool HasArm64Image { get; set; } + + // DotnetSdkVersions is used to specify a specific version of the .NET SDK to be installed on the CodeBuild image + // The default behavior is to specify a channel and that installs the latest version in that channel + // By specifying a specific .NET SDK version, you override the default channel behavior + public string SpecificSdkVersion { get; set; } = string.Empty; +} diff --git a/LambdaRuntimeDockerfiles/Infrastructure/src/Infrastructure/Infrastructure.csproj b/LambdaRuntimeDockerfiles/Infrastructure/src/Infrastructure/Infrastructure.csproj index ddb058822..3a5ab3166 100644 --- a/LambdaRuntimeDockerfiles/Infrastructure/src/Infrastructure/Infrastructure.csproj +++ b/LambdaRuntimeDockerfiles/Infrastructure/src/Infrastructure/Infrastructure.csproj @@ -9,7 +9,7 @@ - +