From 8a75d127e26ea8d54c4fd42c5f2618ed816f8f20 Mon Sep 17 00:00:00 2001 From: Pradumna Saraf Date: Thu, 16 Oct 2025 17:07:06 +0530 Subject: [PATCH 01/10] docs: Update Bun guide to clarify base image options and enhance DHI information --- content/guides/bun/_index.md | 2 +- content/guides/bun/containerize.md | 52 +++++++++++++++++++++++++----- 2 files changed, 45 insertions(+), 9 deletions(-) diff --git a/content/guides/bun/_index.md b/content/guides/bun/_index.md index 3c304a9cbf37..bfe951365898 100644 --- a/content/guides/bun/_index.md +++ b/content/guides/bun/_index.md @@ -10,7 +10,7 @@ params: time: 10 minutes --- -The Bun getting started guide teaches you how to create a containerized Bun application using Docker. In this guide, you'll learn how to: +The Bun getting started guide teaches you how to create a containerized Bun application using Docker. This guide supports using either the official Bun image or Docker Hardened Images (DHI). In this guide, you'll learn how to: > **Acknowledgment** > diff --git a/content/guides/bun/containerize.md b/content/guides/bun/containerize.md index 536f9f080d67..e0291a555817 100644 --- a/content/guides/bun/containerize.md +++ b/content/guides/bun/containerize.md @@ -50,12 +50,44 @@ You should now have the following contents in your `bun-docker` directory. │ └── README.md ``` -In the Dockerfile, you'll notice that the `FROM` instruction uses `oven/bun` -as the base image. This is the official image for Bun created by Oven, the -company behind Bun. This image is [available on the Docker Hub](https://hub.docker.com/r/oven/bun). +## Create a Dockerfile + +Before creating a Dockerfile, you need to choose a base image. You can use either the official image from Oven (the company behind Bun) or a Docker Hardened Image (DHI) from your private DHI catalog. + +The benefit of choosing DHI is that it is a security-focused image that is built to be minimal and secure. Learn more about DHI [here](/dhi/). + +{{< tabs >}} +{{< tab name="Using Docker Hardened Images" >}} +Docker Hardened Images (DHIs) are available for Bun on [Docker Hub](https://hub.docker.com/hardened-images/catalog/dhi/bun). Unlike using the official image, you must first mirror the Bun image into your organization and then use it as your base image. Follow the [DHI quickstart](/dhi/get-started/) to create a mirrored repository for Bun. + +Mirrored repositories must start with `dhi-`, for example: `FROM /dhi-bun:`. In the following Dockerfile, the `FROM` instruction uses `/dhi-bun:1` as the base image. ```dockerfile -# Use the Bun image as the base image +# Use the DHI Bun image as the base image +FROM /dhi-bun:1 + +# Set the working directory in the container +WORKDIR /app + +# Copy the current directory contents into the container at /app +COPY . . + +# Expose the port on which the API will listen +EXPOSE 3000 + +# Run the server when the container launches +CMD ["bun", "server.js"] +``` + +{{< /tab >}} +{{< tab name="Using the official image" >}} + +Using the official image is straightforward. In the following Dockerfile, you'll notice that the `FROM` instruction uses `oven/bun` as the base image. + +You can find the image on [Docker Hub](https://hub.docker.com/r/oven/bun). This is the official image for Bun created by Oven, the company behind Bun, and it's available on Docker Hub. + +```dockerfile +# Use the official Bun image FROM oven/bun:latest # Set the working directory in the container @@ -71,11 +103,14 @@ EXPOSE 3000 CMD ["bun", "server.js"] ``` -Aside from specifying `oven/bun` as the base image, this Dockerfile also: +{{< /tab >}} +{{< /tabs >}} + +Aside from specifying the base image, the Dockerfile also: -- Sets the working directory in the container to `/app` -- Copies the contents of the current directory to the `/app` directory in the container -- Exposes port 3000, where the API is listening for requests +- Sets the working directory in the container to `/app`. +- Copies the contents of the current directory to the `/app` directory in the container. +- Exposes port 3000, where the API is listening for requests. - And finally, starts the server when the container launches with the command `bun server.js`. ## Run the application @@ -120,6 +155,7 @@ Related information: - [.dockerignore file](/reference/dockerfile.md#dockerignore-file) - [Docker Compose overview](/manuals/compose/_index.md) - [Compose file reference](/reference/compose-file/_index.md) + - [Docker Hardened Images](/dhi/) ## Next steps From 122cff7bc0bcb4e643adc76a4771bd6b4f72be40 Mon Sep 17 00:00:00 2001 From: Pradumna Saraf Date: Thu, 16 Oct 2025 23:34:08 +0530 Subject: [PATCH 02/10] Update content/guides/bun/containerize.md Co-authored-by: Usha Mandya <47779042+usha-mandya@users.noreply.github.com> --- content/guides/bun/containerize.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/guides/bun/containerize.md b/content/guides/bun/containerize.md index e0291a555817..555aecdce019 100644 --- a/content/guides/bun/containerize.md +++ b/content/guides/bun/containerize.md @@ -109,7 +109,7 @@ CMD ["bun", "server.js"] Aside from specifying the base image, the Dockerfile also: - Sets the working directory in the container to `/app`. -- Copies the contents of the current directory to the `/app` directory in the container. +- Copies the content of the current directory to the `/app` directory in the container. - Exposes port 3000, where the API is listening for requests. - And finally, starts the server when the container launches with the command `bun server.js`. From e9c7caca0d11697206244ee0de7d7d4624d8b24f Mon Sep 17 00:00:00 2001 From: Pradumna Saraf Date: Thu, 16 Oct 2025 23:34:17 +0530 Subject: [PATCH 03/10] Update content/guides/bun/containerize.md Co-authored-by: Usha Mandya <47779042+usha-mandya@users.noreply.github.com> --- content/guides/bun/containerize.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/guides/bun/containerize.md b/content/guides/bun/containerize.md index 555aecdce019..1b5c6b515268 100644 --- a/content/guides/bun/containerize.md +++ b/content/guides/bun/containerize.md @@ -54,7 +54,7 @@ You should now have the following contents in your `bun-docker` directory. Before creating a Dockerfile, you need to choose a base image. You can use either the official image from Oven (the company behind Bun) or a Docker Hardened Image (DHI) from your private DHI catalog. -The benefit of choosing DHI is that it is a security-focused image that is built to be minimal and secure. Learn more about DHI [here](/dhi/). +Choosing DHI offers the advantage of a production-ready image that is lightweight and secure. For more information, see [Docker Hardened Images](https://docs.docker.com/dhi/). {{< tabs >}} {{< tab name="Using Docker Hardened Images" >}} From 31074a4785f511806277fe2b3f51788c3a2194ef Mon Sep 17 00:00:00 2001 From: Pradumna Saraf Date: Thu, 16 Oct 2025 23:34:33 +0530 Subject: [PATCH 04/10] Update content/guides/bun/containerize.md Co-authored-by: Usha Mandya <47779042+usha-mandya@users.noreply.github.com> --- content/guides/bun/containerize.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/guides/bun/containerize.md b/content/guides/bun/containerize.md index 1b5c6b515268..6abe0447147e 100644 --- a/content/guides/bun/containerize.md +++ b/content/guides/bun/containerize.md @@ -106,7 +106,7 @@ CMD ["bun", "server.js"] {{< /tab >}} {{< /tabs >}} -Aside from specifying the base image, the Dockerfile also: +In addition to specifying the base image, the Dockerfile also: - Sets the working directory in the container to `/app`. - Copies the content of the current directory to the `/app` directory in the container. From 9a5d74734ecef552d4e3f0aca59d12bf643787af Mon Sep 17 00:00:00 2001 From: Pradumna Saraf Date: Thu, 16 Oct 2025 23:34:39 +0530 Subject: [PATCH 05/10] Update content/guides/bun/containerize.md Co-authored-by: Usha Mandya <47779042+usha-mandya@users.noreply.github.com> --- content/guides/bun/containerize.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/guides/bun/containerize.md b/content/guides/bun/containerize.md index 6abe0447147e..7d3988591d40 100644 --- a/content/guides/bun/containerize.md +++ b/content/guides/bun/containerize.md @@ -52,7 +52,7 @@ You should now have the following contents in your `bun-docker` directory. ## Create a Dockerfile -Before creating a Dockerfile, you need to choose a base image. You can use either the official image from Oven (the company behind Bun) or a Docker Hardened Image (DHI) from your private DHI catalog. +Before creating a Dockerfile, you need to choose a base image. You can either use the [Bun Docker Official Image](https://hub.docker.com/r/oven/bun) or a Docker Hardened Image (DHI) from the [Hardened Image catalog](https://hub.docker.com/hardened-images/catalog). Choosing DHI offers the advantage of a production-ready image that is lightweight and secure. For more information, see [Docker Hardened Images](https://docs.docker.com/dhi/). From 6d78ccfad6bc873524ed3325bcd48c87c4f58c71 Mon Sep 17 00:00:00 2001 From: Pradumna Saraf Date: Thu, 16 Oct 2025 23:34:49 +0530 Subject: [PATCH 06/10] Update content/guides/bun/containerize.md Co-authored-by: Usha Mandya <47779042+usha-mandya@users.noreply.github.com> --- content/guides/bun/containerize.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/guides/bun/containerize.md b/content/guides/bun/containerize.md index 7d3988591d40..020fd9049ffe 100644 --- a/content/guides/bun/containerize.md +++ b/content/guides/bun/containerize.md @@ -84,7 +84,7 @@ CMD ["bun", "server.js"] Using the official image is straightforward. In the following Dockerfile, you'll notice that the `FROM` instruction uses `oven/bun` as the base image. -You can find the image on [Docker Hub](https://hub.docker.com/r/oven/bun). This is the official image for Bun created by Oven, the company behind Bun, and it's available on Docker Hub. +You can find the image on [Docker Hub](https://hub.docker.com/r/oven/bun). This is the Docker Official Image for Bun created by Oven, the company behind Bun, and it's available on Docker Hub. ```dockerfile # Use the official Bun image From 2d3b884803eba92b326c2b029d86283684e0756e Mon Sep 17 00:00:00 2001 From: Pradumna Saraf Date: Thu, 16 Oct 2025 23:34:57 +0530 Subject: [PATCH 07/10] Update content/guides/bun/containerize.md Co-authored-by: Usha Mandya <47779042+usha-mandya@users.noreply.github.com> --- content/guides/bun/containerize.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/guides/bun/containerize.md b/content/guides/bun/containerize.md index 020fd9049ffe..08fb45f980ff 100644 --- a/content/guides/bun/containerize.md +++ b/content/guides/bun/containerize.md @@ -58,7 +58,7 @@ Choosing DHI offers the advantage of a production-ready image that is lightweigh {{< tabs >}} {{< tab name="Using Docker Hardened Images" >}} -Docker Hardened Images (DHIs) are available for Bun on [Docker Hub](https://hub.docker.com/hardened-images/catalog/dhi/bun). Unlike using the official image, you must first mirror the Bun image into your organization and then use it as your base image. Follow the [DHI quickstart](/dhi/get-started/) to create a mirrored repository for Bun. +Docker Hardened Images (DHIs) are available for Bun on [Docker Hub](https://hub.docker.com/hardened-images/catalog/dhi/bun). Unlike using the Docker Official Image, you must first mirror the Bun 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 Bun. Mirrored repositories must start with `dhi-`, for example: `FROM /dhi-bun:`. In the following Dockerfile, the `FROM` instruction uses `/dhi-bun:1` as the base image. From 35a3241f462796113a003e467582877d85242fc7 Mon Sep 17 00:00:00 2001 From: Pradumna Saraf Date: Thu, 16 Oct 2025 23:35:03 +0530 Subject: [PATCH 08/10] Update content/guides/bun/containerize.md Co-authored-by: Usha Mandya <47779042+usha-mandya@users.noreply.github.com> --- content/guides/bun/containerize.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/guides/bun/containerize.md b/content/guides/bun/containerize.md index 08fb45f980ff..1353effc9448 100644 --- a/content/guides/bun/containerize.md +++ b/content/guides/bun/containerize.md @@ -82,7 +82,7 @@ CMD ["bun", "server.js"] {{< /tab >}} {{< tab name="Using the official image" >}} -Using the official image is straightforward. In the following Dockerfile, you'll notice that the `FROM` instruction uses `oven/bun` as the base image. +Using the Docker Official Image is straightforward. In the following Dockerfile, you'll notice that the `FROM` instruction uses `oven/bun` as the base image. You can find the image on [Docker Hub](https://hub.docker.com/r/oven/bun). This is the Docker Official Image for Bun created by Oven, the company behind Bun, and it's available on Docker Hub. From 4ef49bda9f936bc8c1378ea71eafb99225637460 Mon Sep 17 00:00:00 2001 From: Pradumna Saraf Date: Fri, 17 Oct 2025 17:46:04 +0530 Subject: [PATCH 09/10] Update content/guides/bun/_index.md Co-authored-by: Usha Mandya <47779042+usha-mandya@users.noreply.github.com> --- content/guides/bun/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/guides/bun/_index.md b/content/guides/bun/_index.md index bfe951365898..380885ff2e48 100644 --- a/content/guides/bun/_index.md +++ b/content/guides/bun/_index.md @@ -10,7 +10,7 @@ params: time: 10 minutes --- -The Bun getting started guide teaches you how to create a containerized Bun application using Docker. This guide supports using either the official Bun image or Docker Hardened Images (DHI). In this guide, you'll learn how to: +The Bun getting started guide teaches you how to create a containerized Bun application using Docker. This guide supports using either the official Bun image or Docker Hardened Images (DHI). > **Acknowledgment** > From f5668d437f2b3ed497f1680a609ed57ac3ade729 Mon Sep 17 00:00:00 2001 From: Pradumna Saraf Date: Fri, 17 Oct 2025 17:54:24 +0530 Subject: [PATCH 10/10] Update Bun getting started guide description Removed mention of Docker Hardened Images (DHI) from the guide description. --- content/guides/bun/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/guides/bun/_index.md b/content/guides/bun/_index.md index 380885ff2e48..7ffc0a5d6ee9 100644 --- a/content/guides/bun/_index.md +++ b/content/guides/bun/_index.md @@ -10,7 +10,7 @@ params: time: 10 minutes --- -The Bun getting started guide teaches you how to create a containerized Bun application using Docker. This guide supports using either the official Bun image or Docker Hardened Images (DHI). +The Bun getting started guide teaches you how to create a containerized Bun application using Docker. > **Acknowledgment** >