Skip to content

Commit 7d658cd

Browse files
Updated Ruby guide to use dhi.io (#23863)
<!--Delete sections as needed --> * Updated Ruby containerization guide to use dhi.io for hardened images. * Used abbreviations for hardened images (DHI) and official images (DOI) to align with official manuals (https://docs.docker.com/dhi/migration/examples/go/). Optional and can be changed to a better wording. * Bumped Ruby version to 3.4.8. ## Reviews <!-- Notes for reviewers here --> <!-- List applicable reviews (optionally @tag reviewers) --> - [ ] Technical review - [x] Editorial review - [ ] Product review
1 parent df6b585 commit 7d658cd

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

content/guides/ruby/containerize.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,18 @@ If you have an existing Rails application, you will need to create the Docker as
2626

2727
## 1. Initialize Docker assets
2828

29-
Rails 7.1 and newer generates multistage Dockerfile out of the box. Following are two versions of such a file: one using Docker Hardened Images (DHI) and another using the official Docker image.
29+
Rails 7.1 and newer generates multistage Dockerfile out of the box. Following are two versions of such a file: one using Docker Hardened Images (DHIs) and another using the Docker Official Image (DOIs). Although the Dockerfile is generated automatically, understanding its purpose and functionality is important. Reviewing the following example is highly recommended.
3030

31-
> [Docker Hardened Images (DHIs)](https://docs.docker.com/dhi/) are minimal, secure, and production-ready container base and application images maintained by Docker.
31+
[Docker Hardened Images (DHIs)](https://docs.docker.com/dhi/) are minimal, secure, and production-ready container base and application images maintained by Docker. DHIs are recommended whenever it is possible for better security. They are designed to reduce vulnerabilities and simplify compliance, freely available to everyone with no subscription required, no usage restrictions, and no vendor lock-in.
3232

33-
DHI images are recommended whenever it is possible for better security. They are designed to reduce vulnerabilities and simplify compliance.
33+
Multistage Dockerfiles help create smaller, more efficient images by separating build and runtime dependencies, ensuring only necessary components are included in the final image. Read more in the [Multi-stage builds guide](/get-started/docker-concepts/building-images/multi-stage-builds/).
3434

35-
> Multistage Dockerfiles help create smaller, more efficient images by separating build and runtime dependencies, ensuring only necessary components are included in the final image. Read more in the [Multi-stage builds guide](/get-started/docker-concepts/building-images/multi-stage-builds/).
3635

37-
Although the Dockerfile is generated automatically, understanding its purpose and functionality is important. Reviewing the following example is highly recommended.
3836

3937
{{< tabs >}}
40-
{{< tab name="Using Docker Hardened Images" >}}
38+
{{< tab name="Using DHIs" >}}
39+
40+
You must authenticate to `dhi.io` before you can pull Docker Hardened Images. Run `docker login dhi.io` to authenticate.
4141

4242
```dockerfile {title=Dockerfile}
4343
# syntax=docker/dockerfile:1
@@ -50,8 +50,8 @@ Although the Dockerfile is generated automatically, understanding its purpose an
5050
# For a containerized dev environment, see Dev Containers: https://guides.rubyonrails.org/getting_started_with_devcontainer.html
5151

5252
# Make sure RUBY_VERSION matches the Ruby version in .ruby-version
53-
ARG RUBY_VERSION=3.4.7
54-
FROM <your-namespace>/dhi-ruby:$RUBY_VERSION-dev AS base
53+
ARG RUBY_VERSION=3.4.8
54+
FROM dhi.io/ruby:$RUBY_VERSION-dev AS base
5555

5656
# Rails app lives here
5757
WORKDIR /rails
@@ -134,7 +134,7 @@ CMD ["./bin/thrust", "./bin/rails", "server"]
134134
```
135135

136136
{{< /tab >}}
137-
{{< tab name="Using the official Docker image" >}}
137+
{{< tab name="Using DOIs" >}}
138138

139139
```dockerfile {title=Dockerfile}
140140
# syntax=docker/dockerfile:1
@@ -147,7 +147,7 @@ CMD ["./bin/thrust", "./bin/rails", "server"]
147147
# For a containerized dev environment, see Dev Containers: https://guides.rubyonrails.org/getting_started_with_devcontainer.html
148148

149149
# Make sure RUBY_VERSION matches the Ruby version in .ruby-version
150-
ARG RUBY_VERSION=3.4.7
150+
ARG RUBY_VERSION=3.4.8
151151
FROM docker.io/library/ruby:$RUBY_VERSION-slim AS base
152152

153153
# Rails app lives here

0 commit comments

Comments
 (0)