Skip to content

Commit d6d354f

Browse files
committed
updated DHI in .NET 10 guide
1 parent a40add5 commit d6d354f

5 files changed

Lines changed: 53 additions & 21 deletions

File tree

content/guides/dotnet/containerize.md

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,22 @@ Now that you have an application, you can create the necessary Docker assets to
4646
{{< tabs >}}
4747
{{< tab name="Using Docker Hardened Images" >}}
4848

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.
5050

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+
```
5265

5366
You can use `docker init` to generate Docker assets, then modify the Dockerfile to use DHI images:
5467

@@ -70,27 +83,27 @@ Let's get started!
7083
? What local port do you want to use to access your server? 8080
7184
```
7285

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.
7487

7588
```dockerfile {title=Dockerfile}
7689
# syntax=docker/dockerfile:1
7790

78-
FROM --platform=$BUILDPLATFORM <your-namespace>/dhi-dotnet:10-sdk AS build
91+
FROM --platform=$BUILDPLATFORM dhi.io/dotnet:10-sdk AS build
7992
ARG TARGETARCH
8093
COPY . /source
8194
WORKDIR /source/src
8295
RUN --mount=type=cache,id=nuget,target=/root/.nuget/packages \
8396
dotnet publish -a ${TARGETARCH/amd64/x64} --use-current-runtime --self-contained false -o /app
8497

85-
FROM <your-namespace>/dhi-aspnetcore:10
98+
FROM dhi.io/aspnetcore:10
8699
WORKDIR /app
87100
COPY --from=build /app .
88101
ENTRYPOINT ["dotnet", "myWebApp.dll"]
89102
```
90103

91104
> [!NOTE]
92105
>
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.
94107
95108
{{< /tab >}}
96109
{{< tab name="Using the official .NET 10 image" >}}

content/guides/dotnet/develop.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,19 +310,19 @@ The following is the updated Dockerfile.
310310
```Dockerfile {hl_lines="10-13"}
311311
# syntax=docker/dockerfile:1
312312
313-
FROM --platform=$BUILDPLATFORM <your-namespace>/dhi-dotnet:10-sdk AS build
313+
FROM --platform=$BUILDPLATFORM dhi.io/dotnet:10-sdk AS build
314314
ARG TARGETARCH
315315
COPY . /source
316316
WORKDIR /source/src
317317
RUN --mount=type=cache,id=nuget,target=/root/.nuget/packages \
318318
dotnet publish -a ${TARGETARCH/amd64/x64} --use-current-runtime --self-contained false -o /app
319319
320-
FROM <your-namespace>/dhi-dotnet:10-sdk AS development
320+
FROM dhi.io/dotnet:10-sdk AS development
321321
COPY . /source
322322
WORKDIR /source/src
323323
CMD dotnet run --no-launch-profile
324324
325-
FROM <your-namespace>/dhi-aspnetcore:10
325+
FROM dhi.io/aspnetcore:10
326326
WORKDIR /app
327327
COPY --from=build /app .
328328
ENTRYPOINT ["dotnet", "myWebApp.dll"]
@@ -409,7 +409,7 @@ secrets:
409409
file: db/password.txt
410410
```
411411

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`.
413413

414414
## Summary
415415

content/guides/dotnet/run-tests.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,20 +53,20 @@ The following is the updated Dockerfile.
5353
```dockerfile {hl_lines="9"}
5454
# syntax=docker/dockerfile:1
5555

56-
FROM --platform=$BUILDPLATFORM <your-namespace>/dhi-dotnet:10-sdk AS build
56+
FROM --platform=$BUILDPLATFORM dhi.io/dotnet:10-sdk AS build
5757
ARG TARGETARCH
5858
COPY . /source
5959
WORKDIR /source/src
6060
RUN --mount=type=cache,id=nuget,target=/root/.nuget/packages \
6161
dotnet publish -a ${TARGETARCH/amd64/x64} --use-current-runtime --self-contained false -o /app
6262
RUN dotnet test /source/tests
6363

64-
FROM <your-namespace>/dhi-dotnet:10-sdk AS development
64+
FROM dhi.io/dotnet:10-sdk AS development
6565
COPY . /source
6666
WORKDIR /source/src
6767
CMD dotnet run --no-launch-profile
6868

69-
FROM <your-namespace>/dhi-aspnetcore:10
69+
FROM dhi.io/aspnetcore:10
7070
WORKDIR /app
7171
COPY --from=build /app .
7272
ENTRYPOINT ["dotnet", "myWebApp.dll"]

content/guides/nodejs/containerize.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -323,17 +323,25 @@ Choosing DHI offers the advantage of a production-ready image that is lightweigh
323323

324324
{{< tabs >}}
325325
{{< 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.
327327

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.
329337

330338
```dockerfile
331339
# ========================================
332340
# Optimized Multi-Stage Dockerfile
333341
# Node.js TypeScript Application (Using DHI)
334342
# ========================================
335343
336-
FROM <your-namespace>/dhi-node:24-alpine3.22-dev AS base
344+
FROM dhi.io/node:24-alpine3.22-dev AS base
337345
338346
# Set working directory
339347
WORKDIR /app
@@ -419,7 +427,7 @@ CMD ["npm", "run", "dev:docker"]
419427
# ========================================
420428
# Production Stage
421429
# ========================================
422-
FROM <your-namespace>/dhi-node:24-alpine3.22-dev AS production
430+
FROM dhi.io/node:24-alpine3.22-dev AS production
423431
424432
# Set working directory
425433
WORKDIR /app

content/guides/python/containerize.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ aliases:
1414
## Prerequisites
1515

1616
- 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.
1818

1919
## Overview
2020

@@ -314,8 +314,19 @@ venv.bak/
314314
{{< /tab >}}
315315
{{< tab name="Using Docker Hardened Image" >}}
316316

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):
326+
327+
```console
328+
$ docker pull dhi.io/python:3.12.12-debian13-fips-dev
329+
```
319330

320331
Create a file named `Dockerfile` with the following contents.
321332

@@ -331,7 +342,7 @@ Create a file named `Dockerfile` with the following contents.
331342
# This Dockerfile uses Docker Hardened Images (DHI) for enhanced security.
332343
# For more information, see https://docs.docker.com/dhi/
333344
ARG PYTHON_VERSION=3.12.12-debian13-fips-dev
334-
FROM <your-workspace>/dhi-python:${PYTHON_VERSION}
345+
FROM dhi.io/python:${PYTHON_VERSION}
335346
336347
# Prevents Python from writing pyc files.
337348
ENV PYTHONDONTWRITEBYTECODE=1

0 commit comments

Comments
 (0)