Skip to content

Commit e200c97

Browse files
nkrokermoritzheiber
authored andcommitted
Changed README.md for having a use-case of ruby-version-checker to verify RUBY_CHECKSUM
1 parent 22e53b4 commit e200c97

1 file changed

Lines changed: 34 additions & 7 deletions

File tree

README.md

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,23 +39,50 @@ GitHub Actions is set up to gather the latest available Ruby versions with the [
3939

4040
## Compiling your own image
4141

42-
The `Dockerfile` is set up in a way which makes it possible to compile pretty much any recent Ruby release [from the index on the ruby-lang.org website](https://cache.ruby-lang.org/pub/ruby/index.txt). The only two build arguments you need to provide are `RUBY_VERSION` (e.g. `3.1.2`) and the associated `sha256` checksum as `RUBY_CHECKSUM` (e.g. `ca10d017f8a1b6d247556622c841fc56b90c03b1803f87198da1e4fd3ec3bf2a`) of the `tar.gz` package associated with the relevant version. If you wish to pass additional compile-time options you can use the build argument `ADDITIONAL_FLAGS` (e.g. to enable YJIT support for Ruby `3.2.x`):
42+
The `Dockerfile` is set up in a way which makes it possible to compile pretty much any recent Ruby release [from the index on the ruby-lang.org website](https://cache.ruby-lang.org/pub/ruby/index.txt). The only two build arguments you need to provide are `RUBY_VERSION` (e.g. `3.1.2`) and the associated `sha256` checksum as `RUBY_CHECKSUM` (e.g. `ca10d017f8a1b6d247556622c841fc56b90c03b1803f87198da1e4fd3ec3bf2a`) of the `tar.gz` package associated with the relevant version.
43+
44+
**PS:** You can always use the [ruby-version-checker](https://github.com/moritzheiber/ruby-version-checker-rs) container to fetch the latest available Ruby releases and their corresponding checksums:
45+
46+
```console
47+
$ docker run ghcr.io/moritzheiber/ruby-version-checker
48+
# [...]
49+
[
50+
{
51+
"name": "3.0.6",
52+
"url": "https://cache.ruby-lang.org/pub/ruby/3.0/ruby-3.0.6.tar.gz",
53+
"sha256": "6e6cbd490030d7910c0ff20edefab4294dfcd1046f0f8f47f78b597987ac683e"
54+
},
55+
{
56+
"name": "3.1.4",
57+
"url": "https://cache.ruby-lang.org/pub/ruby/3.1/ruby-3.1.4.tar.gz",
58+
"sha256": "a3d55879a0dfab1d7141fdf10d22a07dbf8e5cdc4415da1bde06127d5cc3c7b6"
59+
},
60+
{
61+
"name": "3.2.2",
62+
"url": "https://cache.ruby-lang.org/pub/ruby/3.2/ruby-3.2.2.tar.gz",
63+
"sha256": "96c57558871a6748de5bc9f274e93f4b5aad06cd8f37befa0e8d94e7b8a423bc"
64+
}
65+
]
66+
```
67+
68+
69+
If you wish to pass additional compile-time options you can use the build argument `ADDITIONAL_FLAGS` (e.g. to enable YJIT support for Ruby `3.2.x`):
4370

4471
```console
4572
$ docker build \
46-
--build-arg RUBY_VERSION="3.1.2" \
47-
--build-arg RUBY_CHECKSUM="ca10d017f8a1b6d247556622c841fc56b90c03b1803f87198da1e4fd3ec3bf2a" \
73+
--build-arg RUBY_VERSION="3.1.4" \
74+
--build-arg RUBY_CHECKSUM="a3d55879a0dfab1d7141fdf10d22a07dbf8e5cdc4415da1bde06127d5cc3c7b6" \
4875
--build-arg ADDITIONAL_FLAGS="--enable-yjit" \
49-
-t ruby-jemalloc:3.1.2-slim .
76+
-t ruby-jemalloc:3.1.4-slim .
5077
```
5178
The `Dockerfile` uses [the official Ruby `slim` image](https://hub.docker.com/_/ruby) by default, but you can also use your own base image by passing the build argument `IMAGE_NAME`:
5279

5380
```console
5481
$ docker build \
55-
--build-arg RUBY_VERSION=3.1.2 \
56-
--build-arg RUBY_CHECKSUM=ca10d017f8a1b6d247556622c841fc56b90c03b1803f87198da1e4fd3ec3bf2a \
82+
--build-arg RUBY_VERSION=3.1.4 \
83+
--build-arg RUBY_CHECKSUM=a3d55879a0dfab1d7141fdf10d22a07dbf8e5cdc4415da1bde06127d5cc3c7b6 \
5784
--build-arg IMAGE_NAME=ubuntu:22.04 \
58-
-t ruby-jemalloc:3.1.2-ubuntu-22.04 .
85+
-t ruby-jemalloc:3.1.4-ubuntu-22.04 .
5986
```
6087
_Note: Ruby `3.2.2-slim` is the default when building the Docker image without any build arguments._
6188

0 commit comments

Comments
 (0)