Skip to content

Commit 7542521

Browse files
committed
chore: Update Dockerfiles for .NET 11
1 parent 0838ea4 commit 7542521

File tree

14 files changed

+333
-47
lines changed

14 files changed

+333
-47
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.sh text eol=lf
2+
Dockerfile text eol=lf

.github/workflows/auto-update-Dockerfiles.yml

Lines changed: 51 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@ permissions:
77
on:
88
# Run daily at midnight UTC
99
schedule:
10-
- cron: '0 0 * * *'
10+
- cron: "0 0 * * *"
1111
# Allows to run this workflow manually from the Actions tab for testing
1212
workflow_dispatch:
13-
14-
1513

1614
jobs:
1715
auto-update:
@@ -23,12 +21,14 @@ jobs:
2321
NET_9_ARM64_Dockerfile: "LambdaRuntimeDockerfiles/Images/net9/arm64/Dockerfile"
2422
NET_10_AMD64_Dockerfile: "LambdaRuntimeDockerfiles/Images/net10/amd64/Dockerfile"
2523
NET_10_ARM64_Dockerfile: "LambdaRuntimeDockerfiles/Images/net10/arm64/Dockerfile"
24+
NET_11_AMD64_Dockerfile: "LambdaRuntimeDockerfiles/Images/net11/amd64/Dockerfile"
25+
NET_11_ARM64_Dockerfile: "LambdaRuntimeDockerfiles/Images/net11/arm64/Dockerfile"
2626

2727
steps:
2828
# Checks-out the repository under $GITHUB_WORKSPACE
2929
- uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2 #v4.2.2
3030
with:
31-
ref: 'dev'
31+
ref: "dev"
3232

3333
# Update .NET 8 AMD64 Dockerfile
3434
- name: Update .NET 8 AMD64
@@ -114,6 +114,34 @@ jobs:
114114
Write-Host "Skipping .NET 10 ARM64 update - No version detected"
115115
}
116116
117+
# Update .NET 11 AMD64 Dockerfile
118+
- name: Update .NET 11 AMD64
119+
id: update-net11-amd64
120+
shell: pwsh
121+
env:
122+
DOCKERFILE_PATH: ${{ env.NET_11_AMD64_Dockerfile }}
123+
run: |
124+
$version = & "./LambdaRuntimeDockerfiles/get-latest-aspnet-versions.ps1" -MajorVersion "11"
125+
if (-not [string]::IsNullOrEmpty($version)) {
126+
& "./LambdaRuntimeDockerfiles/update-dockerfile.ps1" -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion $version
127+
} else {
128+
Write-Host "Skipping .NET 11 AMD64 update - No version detected"
129+
}
130+
131+
# Update .NET 11 ARM64 Dockerfile
132+
- name: Update .NET 11 ARM64
133+
id: update-net11-arm64
134+
shell: pwsh
135+
env:
136+
DOCKERFILE_PATH: ${{ env.NET_11_ARM64_Dockerfile }}
137+
run: |
138+
$version = & "./LambdaRuntimeDockerfiles/get-latest-aspnet-versions.ps1" -MajorVersion "11"
139+
if (-not [string]::IsNullOrEmpty($version)) {
140+
& "./LambdaRuntimeDockerfiles/update-dockerfile.ps1" -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion $version
141+
} else {
142+
Write-Host "Skipping .NET 11 ARM64 update - No version detected"
143+
}
144+
117145
# Commit changes and create a branch
118146
- name: Commit and Push
119147
id: commit-push
@@ -157,27 +185,30 @@ jobs:
157185
with:
158186
source_branch: ${{ steps.commit-push.outputs.BRANCH }}
159187
destination_branch: "dev"
160-
pr_title: 'chore: Daily ASP.NET Core version update in Dockerfiles'
161-
pr_body: "This PR automatically updates the Dockerfiles to use the latest ASP.NET Core version.
162-
188+
pr_title: "chore: Daily ASP.NET Core version update in Dockerfiles"
189+
pr_body:
190+
"This PR automatically updates the Dockerfiles to use the latest ASP.NET Core version.
191+
163192
Verify that the Dockerfiles have correct versions and matching SHA512 checksums for ASP.NET Core runtime.
164-
193+
165194
All .NET versions: https://dotnet.microsoft.com/en-us/download/dotnet
166-
195+
167196
*Description of changes:*
168197
\n${{ format
169-
(
170-
'{0}\n{1}\n{2}\n{3}\n{4}\n{5}',
171-
join(steps.update-net8-amd64.outputs.MESSAGE, '\n'),
172-
join(steps.update-net8-arm64.outputs.MESSAGE, '\n'),
173-
join(steps.update-net9-amd64.outputs.MESSAGE, '\n'),
174-
join(steps.update-net9-arm64.outputs.MESSAGE, '\n'),
175-
join(steps.update-net10-amd64.outputs.MESSAGE, '\n'),
176-
join(steps.update-net10-arm64.outputs.MESSAGE, '\n')
177-
)
198+
(
199+
'{0}\n{1}\n{2}\n{3}\n{4}\n{5}',
200+
join(steps.update-net8-amd64.outputs.MESSAGE, '\n'),
201+
join(steps.update-net8-arm64.outputs.MESSAGE, '\n'),
202+
join(steps.update-net9-amd64.outputs.MESSAGE, '\n'),
203+
join(steps.update-net9-arm64.outputs.MESSAGE, '\n'),
204+
join(steps.update-net10-amd64.outputs.MESSAGE, '\n'),
205+
join(steps.update-net10-arm64.outputs.MESSAGE, '\n'),
206+
join(steps.update-net11-amd64.outputs.MESSAGE, '\n'),
207+
join(steps.update-net11-arm64.outputs.MESSAGE, '\n')
208+
)
178209
}}"
179210
github_token: ${{ secrets.GITHUB_TOKEN }}
180-
211+
181212
# Add "Release Not Needed" label to the PR
182213
- name: Add Release Not Needed label
183214
if: ${{ steps.pull-request.outputs.pr_number }}
@@ -191,3 +222,4 @@ jobs:
191222
issue_number: ${{ steps.pull-request.outputs.pr_number }},
192223
labels: ['Release Not Needed']
193224
})
225+
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Build Lambda Runtime Images
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- "LambdaRuntimeDockerfiles/**"
7+
push:
8+
paths:
9+
- "LambdaRuntimeDockerfiles/**"
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
build-runtime-images:
16+
name: Build runtime image (${{ matrix.name }})
17+
runs-on: ubuntu-latest
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
include:
22+
- name: NET 8 AMD64
23+
dockerfile: LambdaRuntimeDockerfiles/Images/net8/amd64/Dockerfile
24+
platform: linux/amd64
25+
- name: NET 8 ARM64
26+
dockerfile: LambdaRuntimeDockerfiles/Images/net8/arm64/Dockerfile
27+
platform: linux/arm64
28+
- name: NET 9 AMD64
29+
dockerfile: LambdaRuntimeDockerfiles/Images/net9/amd64/Dockerfile
30+
platform: linux/amd64
31+
- name: NET 9 ARM64
32+
dockerfile: LambdaRuntimeDockerfiles/Images/net9/arm64/Dockerfile
33+
platform: linux/arm64
34+
- name: NET 10 AMD64
35+
dockerfile: LambdaRuntimeDockerfiles/Images/net10/amd64/Dockerfile
36+
platform: linux/amd64
37+
- name: NET 10 ARM64
38+
dockerfile: LambdaRuntimeDockerfiles/Images/net10/arm64/Dockerfile
39+
platform: linux/arm64
40+
- name: NET 11 AMD64
41+
dockerfile: LambdaRuntimeDockerfiles/Images/net11/amd64/Dockerfile
42+
platform: linux/amd64
43+
- name: NET 11 ARM64
44+
dockerfile: LambdaRuntimeDockerfiles/Images/net11/arm64/Dockerfile
45+
platform: linux/arm64
46+
47+
steps:
48+
- uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2 #v4.2.2
49+
50+
- name: Set up QEMU
51+
uses: docker/setup-qemu-action@v3
52+
53+
- name: Set up Docker Buildx
54+
uses: docker/setup-buildx-action@v3
55+
56+
- name: Build ${{ matrix.name }}
57+
uses: docker/build-push-action@v6
58+
with:
59+
context: .
60+
file: ${{ matrix.dockerfile }}
61+
platforms: ${{ matrix.platform }}
62+
push: false
63+
provenance: false
64+

.github/workflows/update-Dockerfiles.yml

Lines changed: 52 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,20 @@ on:
5050
description: ".NET 10 Next Version"
5151
type: string
5252
required: true
53+
NET_11_AMD64:
54+
description: ".NET 11 AMD64"
55+
type: boolean
56+
required: true
57+
default: true
58+
NET_11_ARM64:
59+
description: ".NET 11 ARM64"
60+
type: boolean
61+
required: true
62+
default: true
63+
NET_11_NEXT_VERSION:
64+
description: ".NET 11 Next Version"
65+
type: string
66+
required: true
5367

5468
jobs:
5569
build:
@@ -61,13 +75,15 @@ jobs:
6175
NET_9_ARM64_Dockerfile: "LambdaRuntimeDockerfiles/Images/net9/arm64/Dockerfile"
6276
NET_10_AMD64_Dockerfile: "LambdaRuntimeDockerfiles/Images/net10/amd64/Dockerfile"
6377
NET_10_ARM64_Dockerfile: "LambdaRuntimeDockerfiles/Images/net10/arm64/Dockerfile"
78+
NET_11_AMD64_Dockerfile: "LambdaRuntimeDockerfiles/Images/net11/amd64/Dockerfile"
79+
NET_11_ARM64_Dockerfile: "LambdaRuntimeDockerfiles/Images/net11/arm64/Dockerfile"
6480

6581
# Steps represent a sequence of tasks that will be executed as part of the job
6682
steps:
6783
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
6884
- uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2 #v4.2.2
6985
with:
70-
ref: 'dev'
86+
ref: "dev"
7187

7288
- name: Update .NET 8 AMD64
7389
id: update-net8-amd64
@@ -129,6 +145,26 @@ jobs:
129145
.\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion "${{ env.NEXT_VERSION }}"
130146
if: ${{ github.event.inputs.NET_10_ARM64 == 'true' }}
131147

148+
- name: Update .NET 11 AMD64
149+
id: update-net11-amd64
150+
shell: pwsh
151+
env:
152+
DOCKERFILE_PATH: ${{ env.NET_11_AMD64_Dockerfile }}
153+
NEXT_VERSION: ${{ github.event.inputs.NET_11_NEXT_VERSION }}
154+
run: |
155+
.\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion "${{ env.NEXT_VERSION }}"
156+
if: ${{ github.event.inputs.NET_11_AMD64 == 'true' }}
157+
158+
- name: Update .NET 11 ARM64
159+
id: update-net11-arm64
160+
shell: pwsh
161+
env:
162+
DOCKERFILE_PATH: ${{ env.NET_11_ARM64_Dockerfile }}
163+
NEXT_VERSION: ${{ github.event.inputs.NET_11_NEXT_VERSION }}
164+
run: |
165+
.\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion "${{ env.NEXT_VERSION }}"
166+
if: ${{ github.event.inputs.NET_11_ARM64 == 'true' }}
167+
132168
# Update Dockerfiles if newer version of ASP.NET Core is available
133169
- name: Commit and Push
134170
id: commit-push
@@ -152,21 +188,24 @@ jobs:
152188
with:
153189
source_branch: ${{ steps.commit-push.outputs.BRANCH }}
154190
destination_branch: "dev"
155-
pr_title: 'chore: ASP.NET Core version update in Dockerfiles'
156-
pr_body: "This PR updates the Dockerfiles to use the latest ASP.NET Core version.
191+
pr_title: "chore: ASP.NET Core version update in Dockerfiles"
192+
pr_body:
193+
"This PR updates the Dockerfiles to use the latest ASP.NET Core version.
157194
Verify listed Dockerfiles that they have correct version and matching SHA512 checksum for ASP.NET Core runtime.
158195
\n\nAll .NET versions https://dotnet.microsoft.com/en-us/download/dotnet
159196
\n\n*Description of changes:*
160197
\n${{ format
161-
(
162-
'{0}\n{1}\n{2}\n{3}\n{4}\n{5}',
163-
join(steps.update-net8-amd64.outputs.MESSAGE, '\n'),
164-
join(steps.update-net8-arm64.outputs.MESSAGE, '\n'),
165-
join(steps.update-net9-amd64.outputs.MESSAGE, '\n'),
166-
join(steps.update-net9-arm64.outputs.MESSAGE, '\n'),
167-
join(steps.update-net10-amd64.outputs.MESSAGE, '\n'),
168-
join(steps.update-net10-arm64.outputs.MESSAGE, '\n')
169-
)
198+
(
199+
'{0}\n{1}\n{2}\n{3}\n{4}\n{5}',
200+
join(steps.update-net8-amd64.outputs.MESSAGE, '\n'),
201+
join(steps.update-net8-arm64.outputs.MESSAGE, '\n'),
202+
join(steps.update-net9-amd64.outputs.MESSAGE, '\n'),
203+
join(steps.update-net9-arm64.outputs.MESSAGE, '\n'),
204+
join(steps.update-net10-amd64.outputs.MESSAGE, '\n'),
205+
join(steps.update-net10-arm64.outputs.MESSAGE, '\n'),
206+
join(steps.update-net11-amd64.outputs.MESSAGE, '\n'),
207+
join(steps.update-net11-arm64.outputs.MESSAGE, '\n')
208+
)
170209
}}"
171210
github_token: ${{ secrets.GITHUB_TOKEN }}
172211

@@ -183,3 +222,4 @@ jobs:
183222
issue_number: ${{ steps.pull-request.outputs.pr_number }},
184223
labels: ['Release Not Needed']
185224
})
225+

LambdaRuntimeDockerfiles/Images/net10/amd64/Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,20 @@ RUN curl -SL --output aspnetcore.tar.gz https://builds.dotnet.microsoft.com/dotn
2727
&& rm aspnetcore.tar.gz
2828

2929

30-
FROM mcr.microsoft.com/dotnet/sdk:10.0-preview-trixie-slim AS builder
30+
FROM mcr.microsoft.com/dotnet/sdk:10.0-noble AS builder
3131
WORKDIR /src
3232
COPY ["Libraries/src/Amazon.Lambda.RuntimeSupport", "Repo/Libraries/src/Amazon.Lambda.RuntimeSupport/"]
3333
COPY ["Libraries/src/SnapshotRestore.Registry", "Repo/Libraries/src/SnapshotRestore.Registry/"]
3434
COPY ["Libraries/src/Amazon.Lambda.Core", "Repo/Libraries/src/Amazon.Lambda.Core/"]
3535
COPY ["buildtools/", "Repo/buildtools/"]
3636
RUN dotnet restore "Repo/Libraries/src/Amazon.Lambda.RuntimeSupport/Amazon.Lambda.RuntimeSupport.csproj" /p:TargetFrameworks=net10.0
37-
WORKDIR "Repo/Libraries/src/Amazon.Lambda.RuntimeSupport"
37+
WORKDIR /src/Repo/Libraries/src/Amazon.Lambda.RuntimeSupport
3838
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
3939

4040

4141
FROM builder AS publish
4242
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
43-
RUN apt-get update && apt-get install -y dos2unix
44-
RUN dos2unix /app/publish/bootstrap.sh && \
43+
RUN sed -i 's/\r$//' /app/publish/bootstrap.sh && \
4544
mv /app/publish/bootstrap.sh /app/publish/bootstrap && \
4645
chmod +x /app/publish/bootstrap
4746
RUN touch /app/publish/empty-certificates.crt

LambdaRuntimeDockerfiles/Images/net10/arm64/Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,20 @@ RUN curl -SL --output aspnetcore.tar.gz https://builds.dotnet.microsoft.com/dotn
2727
&& rm aspnetcore.tar.gz
2828

2929

30-
FROM mcr.microsoft.com/dotnet/sdk:10.0-preview-trixie-slim AS builder
30+
FROM mcr.microsoft.com/dotnet/sdk:10.0-noble AS builder
3131
WORKDIR /src
3232
COPY ["Libraries/src/Amazon.Lambda.RuntimeSupport", "Repo/Libraries/src/Amazon.Lambda.RuntimeSupport/"]
3333
COPY ["Libraries/src/SnapshotRestore.Registry", "Repo/Libraries/src/SnapshotRestore.Registry/"]
3434
COPY ["Libraries/src/Amazon.Lambda.Core", "Repo/Libraries/src/Amazon.Lambda.Core/"]
3535
COPY ["buildtools/", "Repo/buildtools/"]
3636
RUN dotnet restore "Repo/Libraries/src/Amazon.Lambda.RuntimeSupport/Amazon.Lambda.RuntimeSupport.csproj" /p:TargetFrameworks=net10.0
37-
WORKDIR "Repo/Libraries/src/Amazon.Lambda.RuntimeSupport"
37+
WORKDIR /src/Repo/Libraries/src/Amazon.Lambda.RuntimeSupport
3838
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
3939

4040

4141
FROM builder AS publish
4242
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
43-
RUN apt-get update && apt-get install -y dos2unix
44-
RUN dos2unix /app/publish/bootstrap.sh && \
43+
RUN sed -i 's/\r$//' /app/publish/bootstrap.sh && \
4544
mv /app/publish/bootstrap.sh /app/publish/bootstrap && \
4645
chmod +x /app/publish/bootstrap
4746
RUN touch /app/publish/empty-certificates.crt

0 commit comments

Comments
 (0)