Skip to content

Commit 4b3fd39

Browse files
[feat] update the guide to use dhi properly
1 parent e381f0f commit 4b3fd39

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

content/guides/reactjs/containerize.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,17 +129,32 @@ Choosing DHI offers the advantage of a production-ready image that is lightweigh
129129
130130
{{< tabs >}}
131131
{{< tab name="Using Docker Hardened Images" >}}
132-
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.
132+
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.
133133

134-
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.
134+
1. Sign in to the DHI registry:
135+
```console
136+
$ docker login dhi.io
137+
```
138+
139+
2. Pull the Node.js DHI (check the catalog for available versions):
140+
```console
141+
$ docker pull dhi.io/node:24-alpine3.22-dev
142+
```
143+
144+
3. Pull the Nginx DHI (check the catalog for available versions):
145+
```console
146+
$ docker pull dhi.io/nginx:1.28.0-alpine3.21-dev
147+
```
148+
149+
In the following Dockerfile, the `FROM` instructions use `dhi.io/node:24-alpine3.22-dev` and `dhi.io/nginx:1.28.0-alpine3.21-dev` as the base images.
135150

136151
```dockerfile
137152
# =========================================
138153
# Stage 1: Build the React.js Application
139154
# =========================================
140155

141156
# Use a lightweight Node.js image for building (customizable via ARG)
142-
FROM <your-namespace>/dhi-node:24-alpine3.22-dev AS builder
157+
FROM dhi.io/node:24-alpine3.22-dev AS builder
143158

144159
# Set the working directory inside the container
145160
WORKDIR /app
@@ -160,7 +175,7 @@ RUN npm run build
160175
# Stage 2: Prepare Nginx to Serve Static Files
161176
# =========================================
162177

163-
FROM <your-namespace>/dhi-nginx:1.28.0-alpine3.21-dev AS runner
178+
FROM dhi.io/nginx:1.28.0-alpine3.21-dev AS runner
164179

165180
# Copy custom Nginx config
166181
COPY nginx.conf /etc/nginx/nginx.conf

0 commit comments

Comments
 (0)