Skip to content

Commit 07424db

Browse files
Copilotlbussell
andauthored
Add Windows Server Core and Nano Server 2025 .NET sample images (#6515)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: lbussell <36081148+lbussell@users.noreply.github.com> Co-authored-by: Logan Bussell <loganbussell@microsoft.com>
1 parent db9a3bb commit 07424db

File tree

12 files changed

+63
-8
lines changed

12 files changed

+63
-8
lines changed

README.samples.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,13 @@ dotnetapp-chiseled-9.0, dotnetapp-chiseled | [Dockerfile](samples/dotnetapp/Dock
109109
aspnetapp-9.0, aspnetapp | [Dockerfile](samples/aspnetapp/Dockerfile.alpine) | Alpine
110110
aspnetapp-chiseled-9.0, aspnetapp-chiseled | [Dockerfile](samples/aspnetapp/Dockerfile.chiseled) | Ubuntu
111111

112+
### Nano Server 2025 amd64 Tags
113+
114+
Tag | Dockerfile
115+
---------| ---------------
116+
dotnetapp-9.0-nanoserver-ltsc2025, dotnetapp-nanoserver-ltsc2025, dotnetapp-9.0, dotnetapp, latest | [Dockerfile](samples/dotnetapp/Dockerfile.nanoserver)
117+
aspnetapp-9.0-nanoserver-ltsc2025, aspnetapp-nanoserver-ltsc2025, aspnetapp-9.0, aspnetapp | [Dockerfile](samples/aspnetapp/Dockerfile.nanoserver)
118+
112119
### Nano Server 2022 amd64 Tags
113120

114121
Tag | Dockerfile

eng/mcr-tags-metadata-templates/samples-tags.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ $(McrTagsYmlTagGroup:dotnetapp)
33
$(McrTagsYmlTagGroup:dotnetapp-chiseled)
44
$(McrTagsYmlTagGroup:aspnetapp)
55
$(McrTagsYmlTagGroup:aspnetapp-chiseled)
6+
$(McrTagsYmlTagGroup:dotnetapp-nanoserver-ltsc2025)
7+
$(McrTagsYmlTagGroup:aspnetapp-nanoserver-ltsc2025)
68
$(McrTagsYmlTagGroup:dotnetapp-nanoserver-ltsc2022)
79
$(McrTagsYmlTagGroup:aspnetapp-nanoserver-ltsc2022)
810
$(McrTagsYmlTagGroup:dotnetapp-nanoserver-1809)

manifest.samples.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,18 @@
8888
"dotnetapp-9.0-nanoserver-ltsc2022": {},
8989
"dotnetapp-nanoserver-ltsc2022": {}
9090
}
91+
},
92+
{
93+
"buildArgs": {
94+
"TAG": "ltsc2025"
95+
},
96+
"dockerfile": "samples/dotnetapp/Dockerfile.nanoserver",
97+
"os": "windows",
98+
"osVersion": "nanoserver-ltsc2025",
99+
"tags": {
100+
"dotnetapp-9.0-nanoserver-ltsc2025": {},
101+
"dotnetapp-nanoserver-ltsc2025": {}
102+
}
91103
}
92104
]
93105
},
@@ -243,6 +255,27 @@
243255
]
244256
}
245257
]
258+
},
259+
{
260+
"buildArgs": {
261+
"TAG": "ltsc2025"
262+
},
263+
"dockerfile": "samples/aspnetapp/Dockerfile.nanoserver",
264+
"os": "windows",
265+
"osVersion": "nanoserver-ltsc2025",
266+
"tags": {
267+
"aspnetapp-9.0-nanoserver-ltsc2025": {},
268+
"aspnetapp-nanoserver-ltsc2025": {}
269+
},
270+
"customBuildLegGroups": [
271+
{
272+
"name": "test-dependencies",
273+
"type": "Integral",
274+
"dependencies": [
275+
"$(Repo:samples):dotnetapp-9.0-nanoserver-ltsc2025"
276+
]
277+
}
278+
]
246279
}
247280
]
248281
},

samples/aspnetapp/Dockerfile.nanoserver

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# escape=`
22
# Learn about building .NET container images:
33
# https://github.com/dotnet/dotnet-docker/blob/main/samples/README.md
4-
ARG TAG=ltsc2022
4+
ARG TAG=ltsc2025
55
FROM mcr.microsoft.com/dotnet/sdk:9.0-nanoserver-$TAG AS build
66
WORKDIR /source
77

samples/aspnetapp/Dockerfile.windowsservercore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Learn about building .NET container images:
22
# https://github.com/dotnet/dotnet-docker/blob/main/samples/README.md
3-
FROM mcr.microsoft.com/dotnet/sdk:9.0-windowsservercore-ltsc2022 AS build
3+
ARG TAG=ltsc2025
4+
FROM mcr.microsoft.com/dotnet/sdk:9.0-windowsservercore-$TAG AS build
45
WORKDIR /source
56

67
# Copy project file and restore as distinct layers
@@ -12,7 +13,7 @@ COPY --link aspnetapp/. .
1213
RUN dotnet publish --no-restore -o /app
1314

1415
# Runtime stage
15-
FROM mcr.microsoft.com/dotnet/aspnet:9.0-windowsservercore-ltsc2022
16+
FROM mcr.microsoft.com/dotnet/aspnet:9.0-windowsservercore-$TAG
1617
EXPOSE 8080
1718
WORKDIR /app
1819
COPY --link --from=build /app .

samples/aspnetapp/Dockerfile.windowsservercore-iis

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
# Learn about building .NET container images:
33
# https://github.com/dotnet/dotnet-docker/blob/main/samples/README.md
44
# Runtime stage
5-
FROM mcr.microsoft.com/dotnet/aspnet:9.0-windowsservercore-ltsc2022 AS final
5+
ARG TAG=ltsc2025
6+
FROM mcr.microsoft.com/dotnet/aspnet:9.0-windowsservercore-$TAG AS final
67

78
RUN powershell -Command `
89
$ErrorActionPreference = 'Stop'; `
@@ -24,7 +25,7 @@ RUN powershell -Command `
2425
Remove-Item -Force C:\dotnet-hosting-win.exe; `
2526
Remove-Item -Force -Recurse $Env:Temp\*
2627

27-
FROM mcr.microsoft.com/dotnet/sdk:9.0-windowsservercore-ltsc2022 AS build
28+
FROM mcr.microsoft.com/dotnet/sdk:9.0-windowsservercore-$TAG AS build
2829
WORKDIR /source
2930

3031
# Copy project file and restore as distinct layers

samples/aspnetapp/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,3 +163,4 @@ Windows variants of the sample can be pulled via one the following registry addr
163163

164164
- `mcr.microsoft.com/dotnet/samples:aspnetapp-nanoserver-1809`
165165
- `mcr.microsoft.com/dotnet/samples:aspnetapp-nanoserver-ltsc2022`
166+
- `mcr.microsoft.com/dotnet/samples:aspnetapp-nanoserver-ltsc2025`

samples/dotnetapp/Dockerfile.nanoserver

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# escape=`
22
# Learn about building .NET container images:
33
# https://github.com/dotnet/dotnet-docker/blob/main/samples/README.md
4-
ARG TAG=ltsc2022
4+
ARG TAG=ltsc2025
55
FROM mcr.microsoft.com/dotnet/sdk:9.0-nanoserver-$TAG AS build
66
WORKDIR /source
77

samples/dotnetapp/Dockerfile.windowsservercore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Learn about building .NET container images:
22
# https://github.com/dotnet/dotnet-docker/blob/main/samples/README.md
3-
FROM mcr.microsoft.com/dotnet/sdk:9.0-windowsservercore-ltsc2022 AS build
3+
ARG TAG=ltsc2025
4+
FROM mcr.microsoft.com/dotnet/sdk:9.0-windowsservercore-$TAG AS build
45
WORKDIR /source
56

67
# Copy project file and restore as distinct layers
@@ -12,7 +13,7 @@ COPY --link . .
1213
RUN dotnet publish --no-restore -o /app
1314

1415
# Runtime stage
15-
FROM mcr.microsoft.com/dotnet/runtime:9.0-windowsservercore-ltsc2022
16+
FROM mcr.microsoft.com/dotnet/runtime:9.0-windowsservercore-$TAG
1617
WORKDIR /app
1718
COPY --link --from=build /app .
1819
USER ContainerUser

samples/dotnetapp/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,4 @@ Windows variants of the sample can be pulled via one the following image names:
5151

5252
- `mcr.microsoft.com/dotnet/samples:dotnetapp-nanoserver-1809`
5353
- `mcr.microsoft.com/dotnet/samples:dotnetapp-nanoserver-ltsc2022`
54+
- `mcr.microsoft.com/dotnet/samples:dotnetapp-nanoserver-ltsc2025`

0 commit comments

Comments
 (0)