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
Copy file name to clipboardExpand all lines: content/guides/dotnet/containerize.md
+19-6Lines changed: 19 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,9 +46,22 @@ Now that you have an application, you can create the necessary Docker assets to
46
46
{{< tabs >}}
47
47
{{< tab name="Using Docker Hardened Images" >}}
48
48
49
-
Docker Hardened Images (DHIs) for .NET are available on [Docker Hub](https://hub.docker.com/hardened-images/catalog/dhi/aspnetcore). Unlike using the Docker Official Image, you must first mirror the image into your organization. Follow the instructions in the [DHI quickstart](/dhi/get-started/)to create a mirrored repository.
49
+
Docker Hardened Images (DHIs) for .NET are available in the [Docker Hardened Images catalog](https://hub.docker.com/hardened-images/catalog/dhi/aspnetcore). Docker Hardened Images are freely available to everyone with no subscription required. You can pull and use them like any other Docker image after signing in to the DHI registry. For more information, see the [DHI quickstart](/dhi/get-started/)guide.
50
50
51
-
Mirrored repositories must start with `dhi-`, for example: `FROM <your-namespace>/dhi-aspnetcore:<tag>`.
51
+
1. Sign in to the DHI registry:
52
+
```console
53
+
$ docker login dhi.io
54
+
```
55
+
56
+
2. Pull the .NET SDK DHI (check the catalog for available versions):
57
+
```console
58
+
$ docker pull dhi.io/dotnet:10-sdk
59
+
```
60
+
61
+
3. Pull the ASP.NET Core runtime DHI (check the catalog for available versions):
62
+
```console
63
+
$ docker pull dhi.io/aspnetcore:10
64
+
```
52
65
53
66
You can use `docker init` to generate Docker assets, then modify the Dockerfile to use DHI images:
54
67
@@ -70,27 +83,27 @@ Let's get started!
70
83
? What local port do you want to use to access your server? 8080
71
84
```
72
85
73
-
Then update your Dockerfile to use DHI images:
86
+
In the following Dockerfile, the `FROM` instructions use `dhi.io/dotnet:10-sdk` and `dhi.io/aspnetcore:10` as the base images.
74
87
75
88
```dockerfile {title=Dockerfile}
76
89
# syntax=docker/dockerfile:1
77
90
78
-
FROM --platform=$BUILDPLATFORM <your-namespace>/dhi-dotnet:10-sdk AS build
91
+
FROM --platform=$BUILDPLATFORM dhi.io/dotnet:10-sdk AS build
79
92
ARG TARGETARCH
80
93
COPY . /source
81
94
WORKDIR /source/src
82
95
RUN --mount=type=cache,id=nuget,target=/root/.nuget/packages \
83
96
dotnet publish -a ${TARGETARCH/amd64/x64} --use-current-runtime --self-contained false -o /app
84
97
85
-
FROM<your-namespace>/dhi-aspnetcore:10
98
+
FROM dhi.io/aspnetcore:10
86
99
WORKDIR /app
87
100
COPY --from=build /app .
88
101
ENTRYPOINT ["dotnet", "myWebApp.dll"]
89
102
```
90
103
91
104
> [!NOTE]
92
105
>
93
-
> DHI runtime images already run as a non-root user (`nonroot`), so there's no need to create a user or specify `USER` in your Dockerfile. This reduces the attack surface and simplifies your configuration.
106
+
> 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.
94
107
95
108
{{< /tab >}}
96
109
{{< tab name="Using the official .NET 10 image" >}}
Copy file name to clipboardExpand all lines: content/guides/dotnet/develop.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -310,19 +310,19 @@ The following is the updated Dockerfile.
310
310
```Dockerfile {hl_lines="10-13"}
311
311
# syntax=docker/dockerfile:1
312
312
313
-
FROM --platform=$BUILDPLATFORM <your-namespace>/dhi-dotnet:10-sdk AS build
313
+
FROM --platform=$BUILDPLATFORM dhi.io/dotnet:10-sdk AS build
314
314
ARG TARGETARCH
315
315
COPY . /source
316
316
WORKDIR /source/src
317
317
RUN --mount=type=cache,id=nuget,target=/root/.nuget/packages \
318
318
dotnet publish -a ${TARGETARCH/amd64/x64} --use-current-runtime --self-contained false -o /app
319
319
320
-
FROM <your-namespace>/dhi-dotnet:10-sdk AS development
320
+
FROM dhi.io/dotnet:10-sdk AS development
321
321
COPY . /source
322
322
WORKDIR /source/src
323
323
CMD dotnet run --no-launch-profile
324
324
325
-
FROM <your-namespace>/dhi-aspnetcore:10
325
+
FROM dhi.io/aspnetcore:10
326
326
WORKDIR /app
327
327
COPY --from=build /app .
328
328
ENTRYPOINT ["dotnet", "myWebApp.dll"]
@@ -409,7 +409,7 @@ secrets:
409
409
file: db/password.txt
410
410
```
411
411
412
-
Your containerized application will now use the SDK image (either `<your-namespace>/dhi-dotnet:10-sdk` for DHI or `mcr.microsoft.com/dotnet/sdk:10.0-alpine` for official images), which includes development tools like `dotnet test`. Continue to the next section to learn how you can run `dotnet test`.
412
+
Your containerized application will now use the SDK image (either `dhi.io/dotnet:10-sdk` for DHI or `mcr.microsoft.com/dotnet/sdk:10.0-alpine` for official images), which includes development tools like `dotnet test`. Continue to the next section to learn how you can run `dotnet test`.
Copy file name to clipboardExpand all lines: content/guides/nodejs/containerize.md
+12-4Lines changed: 12 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -323,17 +323,25 @@ Choosing DHI offers the advantage of a production-ready image that is lightweigh
323
323
324
324
{{< tabs >}}
325
325
{{< tab name="Using Docker Hardened Images" >}}
326
-
Docker Hardened Images (DHIs) are available for Node.js on [Docker Hub](https://hub.docker.com/hardened-images/catalog/dhi/node). Unlike using the Docker Official Image, you must first mirror the Node.js image into your organization and then use it as your base image. Follow the instructions in the [DHI quickstart](/dhi/get-started/) to create a mirrored repository for Node.js.
326
+
Docker Hardened Images (DHIs) are available for Node.js in the [Docker Hardened Images catalog](https://hub.docker.com/hardened-images/catalog/dhi/node). Docker Hardened Images are freely available to everyone with no subscription required. You can pull and use them like any other Docker image after signing in to the DHI registry. For more information, see the [DHI quickstart](/dhi/get-started/) guide.
327
327
328
-
Mirrored repositories must start with `dhi-`, for example: `FROM <your-namespace>/dhi-node:<tag>`. In the following Dockerfile, the `FROM` instruction uses `<your-namespace>/dhi-node:24-alpine3.22-dev` as the base image.
328
+
1. Sign in to the DHI registry:
329
+
330
+
$ docker login dhi.io
331
+
332
+
2. Pull the Node.js DHI (check the catalog for available versions):
333
+
334
+
$ docker pull dhi.io/node:24-alpine3.22-dev
335
+
336
+
In the following Dockerfile, the `FROM` instruction uses `dhi.io/node:24-alpine3.22-dev` as the base image.
329
337
330
338
```dockerfile
331
339
# ========================================
332
340
# Optimized Multi-Stage Dockerfile
333
341
# Node.js TypeScript Application (Using DHI)
334
342
# ========================================
335
343
336
-
FROM <your-namespace>/dhi-node:24-alpine3.22-dev AS base
Copy file name to clipboardExpand all lines: content/guides/python/containerize.md
+15-4Lines changed: 15 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ aliases:
14
14
## Prerequisites
15
15
16
16
- You have installed the latest version of [Docker Desktop](/get-started/get-docker.md).
17
-
- You have a [git client](https://git-scm.com/downloads). The examples in this section use a command-line based git client, but you can use any client.
17
+
- You have a [Git client](https://git-scm.com/downloads). The examples in this section use a command-line based Git client, but you can use any client.
18
18
19
19
## Overview
20
20
@@ -314,8 +314,19 @@ venv.bak/
314
314
{{< /tab >}}
315
315
{{< tab name="Using Docker Hardened Image" >}}
316
316
317
-
If you don't have Docker Desktop installed or prefer creating the assets
318
-
manually, you can create the following files in your project directory.
317
+
Docker Hardened Images (DHIs) are available for Python in the [Docker Hardened Images catalog](https://hub.docker.com/hardened-images/catalog/dhi/python). Docker Hardened Images are freely available to everyone with no subscription required. You can pull and use them like any other Docker image after signing in to the DHI registry. For more information, see the [DHI quickstart](/dhi/get-started/) guide.
318
+
319
+
1. Sign in to the DHI registry:
320
+
321
+
```console
322
+
$ docker login dhi.io
323
+
```
324
+
325
+
2. Pull the Python DHI (check the catalog for available versions):
0 commit comments