Skip to content
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
7 changes: 7 additions & 0 deletions README.samples.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,13 @@ dotnetapp-chiseled-9.0, dotnetapp-chiseled | [Dockerfile](samples/dotnetapp/Dock
aspnetapp-9.0, aspnetapp | [Dockerfile](samples/aspnetapp/Dockerfile.alpine) | Alpine
aspnetapp-chiseled-9.0, aspnetapp-chiseled | [Dockerfile](samples/aspnetapp/Dockerfile.chiseled) | Ubuntu

### Nano Server 2025 amd64 Tags

Tag | Dockerfile
---------| ---------------
dotnetapp-9.0-nanoserver-ltsc2025, dotnetapp-nanoserver-ltsc2025, dotnetapp-9.0, dotnetapp, latest | [Dockerfile](samples/dotnetapp/Dockerfile.nanoserver)
aspnetapp-9.0-nanoserver-ltsc2025, aspnetapp-nanoserver-ltsc2025, aspnetapp-9.0, aspnetapp | [Dockerfile](samples/aspnetapp/Dockerfile.nanoserver)

### Nano Server 2022 amd64 Tags

Tag | Dockerfile
Expand Down
2 changes: 2 additions & 0 deletions eng/mcr-tags-metadata-templates/samples-tags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ $(McrTagsYmlTagGroup:dotnetapp)
$(McrTagsYmlTagGroup:dotnetapp-chiseled)
$(McrTagsYmlTagGroup:aspnetapp)
$(McrTagsYmlTagGroup:aspnetapp-chiseled)
$(McrTagsYmlTagGroup:dotnetapp-nanoserver-ltsc2025)
$(McrTagsYmlTagGroup:aspnetapp-nanoserver-ltsc2025)
$(McrTagsYmlTagGroup:dotnetapp-nanoserver-ltsc2022)
$(McrTagsYmlTagGroup:aspnetapp-nanoserver-ltsc2022)
$(McrTagsYmlTagGroup:dotnetapp-nanoserver-1809)
Expand Down
33 changes: 33 additions & 0 deletions manifest.samples.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,18 @@
"dotnetapp-9.0-nanoserver-ltsc2022": {},
"dotnetapp-nanoserver-ltsc2022": {}
}
},
{
"buildArgs": {
"TAG": "ltsc2025"
},
"dockerfile": "samples/dotnetapp/Dockerfile.nanoserver",
"os": "windows",
"osVersion": "nanoserver-ltsc2025",
"tags": {
"dotnetapp-9.0-nanoserver-ltsc2025": {},
"dotnetapp-nanoserver-ltsc2025": {}
}
}
]
},
Expand Down Expand Up @@ -243,6 +255,27 @@
]
}
]
},
{
"buildArgs": {
"TAG": "ltsc2025"
},
"dockerfile": "samples/aspnetapp/Dockerfile.nanoserver",
"os": "windows",
"osVersion": "nanoserver-ltsc2025",
"tags": {
"aspnetapp-9.0-nanoserver-ltsc2025": {},
"aspnetapp-nanoserver-ltsc2025": {}
},
"customBuildLegGroups": [
{
"name": "test-dependencies",
"type": "Integral",
"dependencies": [
"$(Repo:samples):dotnetapp-9.0-nanoserver-ltsc2025"
]
}
]
}
]
},
Expand Down
2 changes: 1 addition & 1 deletion samples/aspnetapp/Dockerfile.nanoserver
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# escape=`
# Learn about building .NET container images:
# https://github.com/dotnet/dotnet-docker/blob/main/samples/README.md
ARG TAG=ltsc2022
ARG TAG=ltsc2025
FROM mcr.microsoft.com/dotnet/sdk:9.0-nanoserver-$TAG AS build
WORKDIR /source

Expand Down
5 changes: 3 additions & 2 deletions samples/aspnetapp/Dockerfile.windowsservercore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Learn about building .NET container images:
# https://github.com/dotnet/dotnet-docker/blob/main/samples/README.md
FROM mcr.microsoft.com/dotnet/sdk:9.0-windowsservercore-ltsc2022 AS build
ARG TAG=ltsc2025
FROM mcr.microsoft.com/dotnet/sdk:9.0-windowsservercore-$TAG AS build
WORKDIR /source

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

# Runtime stage
FROM mcr.microsoft.com/dotnet/aspnet:9.0-windowsservercore-ltsc2022
FROM mcr.microsoft.com/dotnet/aspnet:9.0-windowsservercore-$TAG
EXPOSE 8080
WORKDIR /app
COPY --link --from=build /app .
Expand Down
5 changes: 3 additions & 2 deletions samples/aspnetapp/Dockerfile.windowsservercore-iis
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
# Learn about building .NET container images:
# https://github.com/dotnet/dotnet-docker/blob/main/samples/README.md
# Runtime stage
FROM mcr.microsoft.com/dotnet/aspnet:9.0-windowsservercore-ltsc2022 AS final
ARG TAG=ltsc2025
FROM mcr.microsoft.com/dotnet/aspnet:9.0-windowsservercore-$TAG AS final

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

FROM mcr.microsoft.com/dotnet/sdk:9.0-windowsservercore-ltsc2022 AS build
FROM mcr.microsoft.com/dotnet/sdk:9.0-windowsservercore-$TAG AS build
WORKDIR /source

# Copy project file and restore as distinct layers
Expand Down
1 change: 1 addition & 0 deletions samples/aspnetapp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,4 @@ Windows variants of the sample can be pulled via one the following registry addr

- `mcr.microsoft.com/dotnet/samples:aspnetapp-nanoserver-1809`
- `mcr.microsoft.com/dotnet/samples:aspnetapp-nanoserver-ltsc2022`
- `mcr.microsoft.com/dotnet/samples:aspnetapp-nanoserver-ltsc2025`
2 changes: 1 addition & 1 deletion samples/dotnetapp/Dockerfile.nanoserver
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# escape=`
# Learn about building .NET container images:
# https://github.com/dotnet/dotnet-docker/blob/main/samples/README.md
ARG TAG=ltsc2022
ARG TAG=ltsc2025
FROM mcr.microsoft.com/dotnet/sdk:9.0-nanoserver-$TAG AS build
WORKDIR /source

Expand Down
5 changes: 3 additions & 2 deletions samples/dotnetapp/Dockerfile.windowsservercore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Learn about building .NET container images:
# https://github.com/dotnet/dotnet-docker/blob/main/samples/README.md
FROM mcr.microsoft.com/dotnet/sdk:9.0-windowsservercore-ltsc2022 AS build
ARG TAG=ltsc2025
FROM mcr.microsoft.com/dotnet/sdk:9.0-windowsservercore-$TAG AS build
WORKDIR /source

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

# Runtime stage
FROM mcr.microsoft.com/dotnet/runtime:9.0-windowsservercore-ltsc2022
FROM mcr.microsoft.com/dotnet/runtime:9.0-windowsservercore-$TAG
WORKDIR /app
COPY --link --from=build /app .
USER ContainerUser
Expand Down
1 change: 1 addition & 0 deletions samples/dotnetapp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,4 @@ Windows variants of the sample can be pulled via one the following image names:

- `mcr.microsoft.com/dotnet/samples:dotnetapp-nanoserver-1809`
- `mcr.microsoft.com/dotnet/samples:dotnetapp-nanoserver-ltsc2022`
- `mcr.microsoft.com/dotnet/samples:dotnetapp-nanoserver-ltsc2025`
4 changes: 4 additions & 0 deletions samples/selecting-tags.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ The following tags demonstrate the pattern used to describe each operating syste
* `9.0-azurelinux3.0` (Azure Linux 3.0)
* `9.0-bookworm-slim` (Debian 12)
* `9.0-noble` (Ubuntu 24.04)
* `9.0-nanoserver-ltsc2025` (Nano Server LTSC 2025)
* `9.0-nanoserver-ltsc2022` (Nano Server LTSC 2022)
* `9.0-nanoserver-1809` (Nano Server, version 1809)
* `9.0-windowsservercore-ltsc2025` (Windows Server Core LTSC 2025)
* `9.0-windowsservercore-ltsc2022` (Windows Server Core LTSC 2022)
* `9.0-windowsservercore-ltsc2019` (Windows Server Core LTSC 2019)

Expand Down Expand Up @@ -148,7 +150,9 @@ The following tags demonstrate the pattern used to describe each processor, usin
* `9.0-alpine-amd64`
* `9.0-noble-amd64`
* `9.0-bookworm-slim-amd64`
* `9.0-nanoserver-ltsc2025`
* `9.0-nanoserver-ltsc2022`
* `9.0-windowsservercore-ltsc2025`
* `9.0-windowsservercore-ltsc2022`

### ARM64
Expand Down
4 changes: 4 additions & 0 deletions tests/Microsoft.DotNet.Docker.Tests/TestData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -340,15 +340,19 @@ public static class TestData
{
new SampleImageData { OS = OS.NanoServer1809, Arch = Arch.Amd64, IsPublished = true },
new SampleImageData { OS = OS.NanoServerLtsc2022, Arch = Arch.Amd64, IsPublished = true },
new SampleImageData { OS = OS.NanoServerLtsc2025, Arch = Arch.Amd64, IsPublished = true },

new SampleImageData { OS = OS.NanoServerLtsc2022, Arch = Arch.Amd64, DockerfileSuffix = "nanoserver" },
new SampleImageData { OS = OS.NanoServerLtsc2025, Arch = Arch.Amd64, DockerfileSuffix = "nanoserver" },

// Use Nano Server as the OS even though the Dockerfiles are for Windows Server Core. This is because the OS value
// needs to match the filter set by the build/test job. We only produce builds jobs based on what's in the manifest
// and the manifest only defines Nano Server-based Dockerfiles. So we just need to piggyback on the Nano Server
// jobs in order to test the Windows Server Core samples.
new SampleImageData { OS = OS.NanoServerLtsc2022, Arch = Arch.Amd64, DockerfileSuffix = "windowsservercore" },
new SampleImageData { OS = OS.NanoServerLtsc2025, Arch = Arch.Amd64, DockerfileSuffix = "windowsservercore" },
new SampleImageData { OS = OS.NanoServerLtsc2022, Arch = Arch.Amd64, DockerfileSuffix = "windowsservercore-iis" },
new SampleImageData { OS = OS.NanoServerLtsc2025, Arch = Arch.Amd64, DockerfileSuffix = "windowsservercore-iis" },
};

private static readonly ProductImageData[] s_linuxMonitorTestData =
Expand Down