Skip to content

Commit a2765e4

Browse files
committed
Simplify for internal usage
1 parent 66e4faa commit a2765e4

File tree

3 files changed

+7
-113
lines changed

3 files changed

+7
-113
lines changed

.github/workflows/build-push.yaml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,15 @@ jobs:
2828
strategy:
2929
matrix:
3030
version: ${{ fromJSON(needs.gather-versions.outputs.versions) }}
31-
image: [slim, ubuntu-22.04, ubuntu-24.04]
31+
image: [slim]
3232
platform: [amd64, arm64]
3333
include: ${{ fromJSON(needs.gather-versions.outputs.metadata) }}
3434
runs-on: ${{ matrix.platform == 'arm64' && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }}
3535
steps:
3636
- name: Set image_name
3737
id: context
3838
run: |
39-
if [[ "${{ matrix.image }}" == "slim" ]] ; then
40-
echo "image_name=ruby:${{ matrix.version }}-slim" >> ${GITHUB_OUTPUT}
41-
elif [[ "${{ matrix.image }}" == "ubuntu-22.04" ]] ; then
42-
echo "image_name=ubuntu:22.04" >> ${GITHUB_OUTPUT}
43-
elif [[ "${{ matrix.image }}" == "ubuntu-24.04" ]] ; then
44-
echo "image_name=ubuntu:24.04" >> ${GITHUB_OUTPUT}
45-
fi
39+
echo "image_name=ruby:${{ matrix.version }}-slim" >> ${GITHUB_OUTPUT}
4640
4741
if [[ "${{ startsWith(matrix.version, '3.2') }}" == "true" ]] ; then
4842
echo "flags=--enable-yjit" >> ${GITHUB_OUTPUT}
@@ -70,7 +64,7 @@ jobs:
7064
ADDITIONAL_FLAGS=${{ steps.context.outputs.flags }}
7165
provenance: false
7266
outputs: |
73-
type=image,name=ghcr.io/moritzheiber/ruby-jemalloc,push-by-digest=true,push=${{ github.ref == 'refs/heads/main' }}
67+
type=image,name=ghcr.io/feedbackfruits/ruby-jemalloc,push-by-digest=true,push=${{ github.ref == 'refs/heads/main' }}
7468
- name: Export digest
7569
if: github.ref == 'refs/heads/main'
7670
run: |
@@ -93,7 +87,7 @@ jobs:
9387
strategy:
9488
matrix:
9589
version: ${{ fromJSON(needs.gather-versions.outputs.versions) }}
96-
image: [slim, ubuntu-22.04, ubuntu-24.04]
90+
image: [slim]
9791
steps:
9892
- name: Login to GHCR
9993
uses: docker/login-action@v3
@@ -111,5 +105,5 @@ jobs:
111105
- name: Create and push manifest
112106
working-directory: /tmp/digests/${{ matrix.version }}-${{ matrix.image }}
113107
run: |
114-
docker buildx imagetools create -t ghcr.io/moritzheiber/ruby-jemalloc:${{ matrix.version }}-${{ matrix.image }} \
115-
$(printf 'ghcr.io/moritzheiber/ruby-jemalloc@sha256:%s ' *)
108+
docker buildx imagetools create -t ghcr.io/feedbackfruits/ruby-jemalloc:${{ matrix.version }}-${{ matrix.image }} \
109+
$(printf 'ghcr.io/feedbackfruits/ruby-jemalloc@sha256:%s ' *)

.github/workflows/update-readme.yaml

Lines changed: 0 additions & 27 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,17 @@
22

33
A Docker image for Ruby, built with [`jemalloc`](https://scalingo.com/blog/improve-ruby-application-memory-jemalloc).
44

5-
The images are based on [the offical Ruby "slim"](https://hub.docker.com/_/ruby) and [official Ubuntu "22.04"/"24.04" (LTS) images](https://hub.docker.com/_/ubuntu) on Docker Hub.
5+
The images are based on [the offical Ruby "slim"](https://hub.docker.com/_/ruby) on Docker Hub.
66

77
The following images are used:
88

99
- `ruby:${RUBY_VERSION}-slim`
10-
- `ubuntu:22.04`
11-
- `ubuntu:24.04`
1210

1311
The following platforms are built:
1412

1513
- `linux/amd64`
1614
- `linux/arm64`
1715

18-
1916
The following Ruby versions are built:
2017

2118
- `3.1.4`
@@ -24,76 +21,6 @@ The following Ruby versions are built:
2421

2522
Images for Ruby >= 3.2.x are compiled with [YJIT](https://github.com/ruby/ruby/blob/master/doc/yjit/yjit.md) support.
2623

27-
Container images are available but no longer maintained for the following versions:
28-
29-
- `3.0.4`
30-
- `3.0.5`
31-
- `3.0.6`
32-
- `3.1.2`
33-
- `3.1.3`
34-
- `3.1.4`
35-
- `3.2.0`
36-
- `3.2.1`
37-
- `3.2.2`
38-
- `3.2.3`
39-
40-
and the following platforms:
41-
42-
- `ubuntu-20.04`
43-
44-
## Support for newer Ruby versions
45-
46-
GitHub Actions is set up to gather the latest available Ruby versions with the [ruby-versions-action](https://github.com/moritzheiber/ruby-versions-action) and feed it to the build process. The plan is to run the build pipeline and update the REAMDE from a template regularly (e.g. weekly) in the future. For now this has to be done manually, so feel free to open a new issue once a new release needs to be supported (it usually takes a few minutes to trigger the pipeline and update the README).
47-
48-
## Compiling your own image
49-
50-
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.
51-
52-
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:
53-
54-
```console
55-
$ docker run ghcr.io/moritzheiber/ruby-version-checker
56-
# [...]
57-
[
58-
{
59-
"name": "3.0.6",
60-
"url": "https://cache.ruby-lang.org/pub/ruby/3.0/ruby-3.0.6.tar.gz",
61-
"sha256": "6e6cbd490030d7910c0ff20edefab4294dfcd1046f0f8f47f78b597987ac683e"
62-
},
63-
{
64-
"name": "3.1.4",
65-
"url": "https://cache.ruby-lang.org/pub/ruby/3.1/ruby-3.1.4.tar.gz",
66-
"sha256": "a3d55879a0dfab1d7141fdf10d22a07dbf8e5cdc4415da1bde06127d5cc3c7b6"
67-
},
68-
{
69-
"name": "3.2.2",
70-
"url": "https://cache.ruby-lang.org/pub/ruby/3.2/ruby-3.2.2.tar.gz",
71-
"sha256": "96c57558871a6748de5bc9f274e93f4b5aad06cd8f37befa0e8d94e7b8a423bc"
72-
}
73-
]
74-
```
75-
76-
77-
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`):
78-
79-
```console
80-
$ docker build \
81-
--build-arg RUBY_VERSION="3.1.4" \
82-
--build-arg RUBY_CHECKSUM="a3d55879a0dfab1d7141fdf10d22a07dbf8e5cdc4415da1bde06127d5cc3c7b6" \
83-
--build-arg ADDITIONAL_FLAGS="--enable-yjit" \
84-
-t ruby-jemalloc:3.1.4-slim .
85-
```
86-
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`:
87-
88-
```console
89-
$ docker build \
90-
--build-arg RUBY_VERSION=3.1.4 \
91-
--build-arg RUBY_CHECKSUM=a3d55879a0dfab1d7141fdf10d22a07dbf8e5cdc4415da1bde06127d5cc3c7b6 \
92-
--build-arg IMAGE_NAME=ubuntu:22.04 \
93-
-t ruby-jemalloc:3.1.4-ubuntu-22.04 .
94-
```
95-
_Note: Ruby `3.4.1-slim` is the default when building the Docker image without any build arguments._
96-
9724
## Tests
9825

9926
The tests are run using [`goss`](https://github.com/aelsabbahy/goss):

0 commit comments

Comments
 (0)