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
The Node.js containerize guide told readers to create a Dockerfile without saying where it belongs.
Clarify that both Dockerfile options should be created in the project root and clean up existing lint failures in the touched file.
Co-Authored-By: Codex <codex@openai.com>
Copy file name to clipboardExpand all lines: content/guides/nodejs/containerize.md
+34-27Lines changed: 34 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ aliases:
17
17
Before you begin, make sure the following tools are installed and available on your system:
18
18
19
19
- You have installed the latest version of [Docker Desktop](/get-started/get-docker.md).
20
-
- 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.
20
+
- 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.
21
21
22
22
> **New to Docker?**
23
23
> Start with the [Docker basics](/get-started/docker-concepts/the-basics/what-is-a-container.md) guide to get familiar with key concepts like images, containers, and Dockerfiles.
@@ -40,7 +40,7 @@ By the end of this guide, you will:
40
40
41
41
Clone the sample application to use with this guide. Open a terminal, change
42
42
directory to a directory that you want to work in, and run the following command
@@ -70,6 +70,7 @@ Choosing DHI offers the advantage of a production-ready image that is lightweigh
70
70
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.
71
71
72
72
1. Sign in to the DHI registry:
73
+
73
74
```console
74
75
$ docker login dhi.io
75
76
```
@@ -79,7 +80,7 @@ Docker Hardened Images (DHIs) are available for Node.js in the [Docker Hardened
79
80
$ docker pull dhi.io/node:24-alpine3.22-dev
80
81
```
81
82
82
-
Create a file named `Dockerfile` with the following contents. The `FROM` instruction uses `dhi.io/node:24-alpine3.22-dev` as the base image.
83
+
Create a file named `Dockerfile`in your project root with the following contents. The `FROM` instruction uses `dhi.io/node:24-alpine3.22-dev` as the base image.
@@ -580,8 +587,8 @@ The `.dockerignore` file tells Docker which files and folders to exclude when bu
580
587
> [!NOTE]
581
588
> This helps:
582
589
>
583
-
> - Reduce image size
584
-
> - Speed up the build process
590
+
> - Reduce image size
591
+
> - Speed up the build process
585
592
> - Prevent sensitive or unnecessary files (like `.env`, `.git`, or `node_modules`) from being added to the final image.
586
593
>
587
594
> To learn more, visit the [.dockerignore reference](/reference/dockerfile.md#dockerignore-file).
@@ -695,7 +702,7 @@ If the build was successful, you should see `docker-nodejs-sample` image listed.
695
702
696
703
## Run the containerized application
697
704
698
-
In the previous step, you created a Dockerfile for your Node.js application and built a Docker image using the docker build command. Now it’s time to run that image in a container and verify that your application works as expected.
705
+
In the previous step, you created a Dockerfile for your Node.js application and built a Docker image using the `docker build` command. Now it’s time to run that image in a container and verify that your application works as expected.
699
706
700
707
Inside the `docker-nodejs-sample` directory, run the following command in a terminal.
0 commit comments