Skip to content

Commit 0731548

Browse files
authored
Run Docker: Update .NET 10 (#35285)
1 parent cea646d commit 0731548

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

aspnetcore/host-and-deploy/docker/building-net-docker-images.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ author: rick-anderson
44
description: Learn how to use the published ASP.NET Core Docker images from the Docker Registry. Pull and build your own images.
55
ms.author: wpickett
66
ms.custom: mvc, linux-related-content
7-
ms.date: 5/15/2024
7+
ms.date: 04/22/2025
88
uid: host-and-deploy/docker/building-net-docker-images
99
---
1010

aspnetcore/host-and-deploy/docker/includes/building-net-docker-images10.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The sample Dockerfile uses the [Docker multi-stage build feature](https://docs.d
1616

1717
## Prerequisites
1818

19-
* [.NET SDK 9.0](https://dotnet.microsoft.com/download)
19+
* [.NET SDK 10.0](https://dotnet.microsoft.com/download)
2020
* Docker client 18.03 or later
2121

2222
* Linux distributions
@@ -25,7 +25,7 @@ The sample Dockerfile uses the [Docker multi-stage build feature](https://docs.d
2525
* [Ubuntu](https://docs.docker.com/install/linux/docker-ce/ubuntu/)
2626
* [macOS](https://docs.docker.com/desktop/mac/install/)
2727
* [Windows](https://docs.docker.com/desktop/windows/install/)
28-
28+
2929
* [Git](https://git-scm.com/download)
3030

3131
## Download the sample app
@@ -112,7 +112,7 @@ In some scenarios, you might want to deploy an app to a container by copying its
112112
To use the manually published app within a Docker container, create a new *Dockerfile* and use the `docker build .` command to build an image.
113113
114114
```dockerfile
115-
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime
115+
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS runtime
116116
WORKDIR /app
117117
COPY published/ ./
118118
ENTRYPOINT ["dotnet", "aspnetapp.dll"]
@@ -122,11 +122,11 @@ To see the new image use the `docker images` command.
122122

123123
### The Dockerfile
124124

125-
Here's the *Dockerfile* used by the `docker build` command you ran earlier. It uses `dotnet publish` the same way you did in this section to build and deploy.
125+
Here's the *Dockerfile* used by the `docker build` command you ran earlier. It uses `dotnet publish` the same way you did in this section to build and deploy.
126126

127127
```dockerfile
128128
# https://hub.docker.com/_/microsoft-dotnet
129-
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
129+
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
130130
WORKDIR /source
131131

132132
# copy csproj and restore as distinct layers
@@ -140,13 +140,13 @@ WORKDIR /source/aspnetapp
140140
RUN dotnet publish -c release -o /app --no-restore
141141

142142
# final stage/image
143-
FROM mcr.microsoft.com/dotnet/aspnet:9.0
143+
FROM mcr.microsoft.com/dotnet/aspnet:10.0
144144
WORKDIR /app
145145
COPY --from=build /app ./
146146
ENTRYPOINT ["dotnet", "aspnetapp.dll"]
147147
```
148148

149-
In the preceding *Dockerfile*, the `*.csproj` files are copied and restored as distinct *layers*. When the `docker build` command builds an image, it uses a built-in cache. If the `*.csproj` files haven't changed since the `docker build` command last ran, the `dotnet restore` command doesn't need to run again. Instead, the built-in cache for the corresponding `dotnet restore` layer is reused. For more information, see [Best practices for writing Dockerfiles](https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#leverage-build-cache).
149+
In the preceding *Dockerfile*, the `*.csproj` files are copied and restored as distinct *layers*. When the `docker build` command builds an image, it uses a built-in cache. If the `*.csproj` files did not change since the `docker build` command last ran, the `dotnet restore` command doesn't need to run again. Instead, the built-in cache for the corresponding `dotnet restore` layer is reused. For more information, see [Best practices for writing Dockerfiles](https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#leverage-build-cache).
150150

151151
## Additional resources
152152

0 commit comments

Comments
 (0)