You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -112,7 +112,7 @@ In some scenarios, you might want to deploy an app to a container by copying its
112
112
To use the manually published app within a Docker container, create a new *Dockerfile* and use the `docker build .` command to build an image.
113
113
114
114
```dockerfile
115
-
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime
115
+
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS runtime
116
116
WORKDIR /app
117
117
COPY published/ ./
118
118
ENTRYPOINT ["dotnet", "aspnetapp.dll"]
@@ -122,11 +122,11 @@ To see the new image use the `docker images` command.
122
122
123
123
### The Dockerfile
124
124
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.
126
126
127
127
```dockerfile
128
128
# 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
130
130
WORKDIR /source
131
131
132
132
# copy csproj and restore as distinct layers
@@ -140,13 +140,13 @@ WORKDIR /source/aspnetapp
140
140
RUN dotnet publish -c release -o /app --no-restore
141
141
142
142
# final stage/image
143
-
FROM mcr.microsoft.com/dotnet/aspnet:9.0
143
+
FROM mcr.microsoft.com/dotnet/aspnet:10.0
144
144
WORKDIR /app
145
145
COPY --from=build /app ./
146
146
ENTRYPOINT ["dotnet", "aspnetapp.dll"]
147
147
```
148
148
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).
0 commit comments