Skip to content

Commit dbc69d8

Browse files
committed
Revert "fix: use .NET 8 images to match sample app (dd-kfun)"
This reverts commit deea6a1.
1 parent 67aa87e commit dbc69d8

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

content/guides/dotnet/containerize.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ Docker Hardened Images (DHIs) for .NET are available in the [Docker Hardened Ima
5555

5656
2. Pull the .NET SDK DHI (check the catalog for available versions):
5757
```console
58-
$ docker pull dhi.io/dotnet:8-sdk
58+
$ docker pull dhi.io/dotnet:10-sdk
5959
```
6060

6161
3. Pull the ASP.NET Core runtime DHI (check the catalog for available versions):
6262
```console
63-
$ docker pull dhi.io/aspnetcore:8
63+
$ docker pull dhi.io/aspnetcore:10
6464
```
6565

6666
You can use `docker init` to generate Docker assets, then modify the Dockerfile to use DHI images:
@@ -79,23 +79,23 @@ Let's get started!
7979

8080
? What application platform does your project use? ASP.NET Core
8181
? What's the name of your solution's main project? myWebApp
82-
? What version of .NET do you want to use? 8.0
82+
? What version of .NET do you want to use? 10.0
8383
? What local port do you want to use to access your server? 8080
8484
```
8585

86-
In the following Dockerfile, the `FROM` instructions use `dhi.io/dotnet:8-sdk` and `dhi.io/aspnetcore:8` as the base images.
86+
In the following Dockerfile, the `FROM` instructions use `dhi.io/dotnet:10-sdk` and `dhi.io/aspnetcore:10` as the base images.
8787

8888
```dockerfile {title=Dockerfile}
8989
# syntax=docker/dockerfile:1
9090

91-
FROM --platform=$BUILDPLATFORM dhi.io/dotnet:8-sdk AS build
91+
FROM --platform=$BUILDPLATFORM dhi.io/dotnet:10-sdk AS build
9292
ARG TARGETARCH
9393
COPY . /source
9494
WORKDIR /source/src
9595
RUN --mount=type=cache,id=nuget,target=/root/.nuget/packages \
9696
dotnet publish -a ${TARGETARCH/amd64/x64} --use-current-runtime --self-contained false -o /app
9797

98-
FROM dhi.io/aspnetcore:8
98+
FROM dhi.io/aspnetcore:10
9999
WORKDIR /app
100100
COPY --from=build /app .
101101
ENTRYPOINT ["dotnet", "myWebApp.dll"]
@@ -106,7 +106,7 @@ ENTRYPOINT ["dotnet", "myWebApp.dll"]
106106
> DHI runtime images already run as a non-root user (`nonroot`, UID 65532), so there's no need to create a user or specify `USER` in your Dockerfile. This reduces the attack surface and simplifies your configuration.
107107
108108
{{< /tab >}}
109-
{{< tab name="Using the official .NET image" >}}
109+
{{< tab name="Using the official .NET 10 image" >}}
110110

111111
You can use `docker init` to create the necessary Docker assets. Inside the `docker-dotnet-sample` directory, run the `docker init` command in a terminal. `docker init` provides some default configuration, but you'll need to answer a few questions about your application. Refer to the following example to answer the prompts from `docker init` and use the same answers for your prompts.
112112

@@ -124,23 +124,23 @@ Let's get started!
124124

125125
? What application platform does your project use? ASP.NET Core
126126
? What's the name of your solution's main project? myWebApp
127-
? What version of .NET do you want to use? 8.0
127+
? What version of .NET do you want to use? 10.0
128128
? What local port do you want to use to access your server? 8080
129129
```
130130

131-
This generates a Dockerfile using the official .NET 8 images from Microsoft Container Registry:
131+
This generates a Dockerfile using the official .NET 10 images from Microsoft Container Registry:
132132

133133
```dockerfile {title=Dockerfile}
134134
# syntax=docker/dockerfile:1
135135

136-
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build
136+
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:10.0-alpine AS build
137137
ARG TARGETARCH
138138
COPY . /source
139139
WORKDIR /source/src
140140
RUN --mount=type=cache,id=nuget,target=/root/.nuget/packages \
141141
dotnet publish -a ${TARGETARCH/amd64/x64} --use-current-runtime --self-contained false -o /app
142142

143-
FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine AS final
143+
FROM mcr.microsoft.com/dotnet/aspnet:10.0-alpine AS final
144144
WORKDIR /app
145145
COPY --from=build /app .
146146
ARG UID=10001

0 commit comments

Comments
 (0)