Skip to content

Commit 6bff036

Browse files
committed
Add Ruby 3.3: changes for Ruby 3.3
(3 step/commit workflow to preserve history)
1 parent 4f75df8 commit 6bff036

7 files changed

+87
-21
lines changed

Diff for: 3.3/Dockerfile.c8s

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
FROM quay.io/sclorg/s2i-base-c8s:c8s
2+
3+
# This image provides a Ruby environment you can use to run your Ruby
4+
# applications.
5+
6+
EXPOSE 8080
7+
8+
ENV RUBY_MAJOR_VERSION=3 \
9+
RUBY_MINOR_VERSION=3
10+
11+
ENV RUBY_VERSION="${RUBY_MAJOR_VERSION}.${RUBY_MINOR_VERSION}" \
12+
RUBY_SCL_NAME_VERSION="${RUBY_MAJOR_VERSION}${RUBY_MINOR_VERSION}"
13+
14+
ENV RUBY_SCL="ruby-${RUBY_SCL_NAME_VERSION}" \
15+
IMAGE_NAME="ubi8/ruby-${RUBY_SCL_NAME_VERSION}" \
16+
SUMMARY="Platform for building and running Ruby $RUBY_VERSION applications" \
17+
DESCRIPTION="Ruby $RUBY_VERSION available as container is a base platform for \
18+
building and running various Ruby $RUBY_VERSION applications and frameworks. \
19+
Ruby is the interpreted scripting language for quick and easy object-oriented programming. \
20+
It has many features to process text files and to do system management tasks (as in Perl). \
21+
It is simple, straight-forward, and extensible."
22+
23+
LABEL summary="$SUMMARY" \
24+
description="$DESCRIPTION" \
25+
io.k8s.description="$DESCRIPTION" \
26+
io.k8s.display-name="Ruby ${RUBY_VERSION}" \
27+
io.openshift.expose-services="8080:http" \
28+
io.openshift.tags="builder,ruby,ruby${RUBY_SCL_NAME_VERSION},${RUBY_SCL}" \
29+
com.redhat.component="${RUBY_SCL}-container" \
30+
name="${IMAGE_NAME}" \
31+
version="1" \
32+
com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \
33+
usage="s2i build https://github.com/sclorg/s2i-ruby-container.git \
34+
--context-dir=${RUBY_VERSION}/test/puma-test-app/ ${IMAGE_NAME} ruby-sample-app" \
35+
maintainer="SoftwareCollections.org <[email protected]>"
36+
37+
RUN yum -y module enable ruby:$RUBY_VERSION && \
38+
INSTALL_PKGS=" \
39+
libffi-devel \
40+
ruby \
41+
ruby-devel \
42+
rubygem-rake \
43+
rubygem-bundler \
44+
ruby-bundled-gems \
45+
redhat-rpm-config \
46+
" && \
47+
yum install -y --setopt=tsflags=nodocs ${INSTALL_PKGS} && \
48+
yum reinstall -y --setopt=tsflags=nodocs tzdata && \
49+
yum -y clean all --enablerepo='*' && \
50+
ruby -v | grep -qe "^ruby $RUBY_VERSION\." && echo "Found VERSION $RUBY_VERSION" && \
51+
rpm -V ${INSTALL_PKGS}
52+
53+
# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH
54+
COPY ./s2i/bin/ $STI_SCRIPTS_PATH
55+
56+
# Copy extra files to the image.
57+
COPY ./root/ /
58+
59+
# Drop the root user and make the content of /opt/app-root owned by user 1001
60+
RUN chown -R 1001:0 ${APP_ROOT} && chmod -R ug+rwx ${APP_ROOT} && \
61+
rpm-file-permissions
62+
63+
USER 1001
64+
65+
# Set the default CMD to print the usage of the language image
66+
CMD $STI_SCRIPTS_PATH/usage

Diff for: 3.3/Dockerfile.c9s

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ FROM quay.io/sclorg/s2i-base-c9s:c9s
66
EXPOSE 8080
77

88
ENV RUBY_MAJOR_VERSION=3 \
9-
RUBY_MINOR_VERSION=1
9+
RUBY_MINOR_VERSION=3
1010

1111
ENV RUBY_VERSION="${RUBY_MAJOR_VERSION}.${RUBY_MINOR_VERSION}" \
1212
RUBY_SCL_NAME_VERSION="${RUBY_MAJOR_VERSION}${RUBY_MINOR_VERSION}"

Diff for: 3.3/Dockerfile.fedora

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
FROM quay.io/fedora/s2i-base:37
1+
FROM quay.io/fedora/s2i-base:39
22

33
# This image provides a Ruby environment you can use to run your Ruby
44
# applications.
55

66
EXPOSE 8080
77

88
ENV NAME=ruby \
9-
RUBY_VERSION=3.1 \
10-
RUBY_SHORT_VER=31 \
9+
RUBY_VERSION=3.3 \
10+
RUBY_SHORT_VER=33 \
1111
VERSION=0
1212

1313
ENV SUMMARY="Platform for building and running Ruby $RUBY_VERSION applications" \

Diff for: 3.3/Dockerfile.rhel8

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ FROM ubi8/s2i-base
66
EXPOSE 8080
77

88
ENV RUBY_MAJOR_VERSION=3 \
9-
RUBY_MINOR_VERSION=1
9+
RUBY_MINOR_VERSION=3
1010

1111
ENV RUBY_VERSION="${RUBY_MAJOR_VERSION}.${RUBY_MINOR_VERSION}" \
1212
RUBY_SCL_NAME_VERSION="${RUBY_MAJOR_VERSION}${RUBY_MINOR_VERSION}"

Diff for: 3.3/Dockerfile.rhel9

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ FROM ubi9/s2i-base
66
EXPOSE 8080
77

88
ENV RUBY_MAJOR_VERSION=3 \
9-
RUBY_MINOR_VERSION=1
9+
RUBY_MINOR_VERSION=3
1010

1111
ENV RUBY_VERSION="${RUBY_MAJOR_VERSION}.${RUBY_MINOR_VERSION}" \
1212
RUBY_SCL_NAME_VERSION="${RUBY_MAJOR_VERSION}${RUBY_MINOR_VERSION}"

Diff for: 3.3/README.md

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
Ruby 3.1 container image
1+
Ruby 3.3 container image
22
========================
3-
This container image includes Ruby 3.1 as a [S2I](https://github.com/openshift/source-to-image) base image for your Ruby 3.1 applications.
3+
This container image includes Ruby 3.3 as a [S2I](https://github.com/openshift/source-to-image) base image for your Ruby 3.3 applications.
44
Users can choose between RHEL, CentOS and Fedora based builder images.
55
The RHEL images are available in the [Red Hat Container Catalog](https://access.redhat.com/containers/),
66
the CentOS images are available on [Quay.io](https://quay.io/organization/centos7),
@@ -12,8 +12,8 @@ Note: while the examples in this README are calling `podman`, you can replace an
1212
Description
1313
-----------
1414

15-
Ruby 3.1 available as container is a base platform for
16-
building and running various Ruby 3.1 applications and frameworks.
15+
Ruby 3.3 available as container is a base platform for
16+
building and running various Ruby 3.3 applications and frameworks.
1717
Ruby is the interpreted scripting language for quick and easy object-oriented programming.
1818
It has many features to process text files and to do system management tasks (as in Perl).
1919
It is simple, straight-forward, and extensible.
@@ -25,12 +25,12 @@ the nodejs itself is included just to make the npm work.
2525

2626
Usage in Openshift
2727
------------------
28-
For this, we will assume that you are using the `ubi8/ruby-31 image`, available via `ruby:3.1` imagestream tag in Openshift.
29-
Building a simple [ruby-sample-app](https://github.com/sclorg/s2i-ruby-container/tree/master/3.1/test/puma-test-app) application
28+
For this, we will assume that you are using the `ubi8/ruby-33 image`, available via `ruby:3.3` imagestream tag in Openshift.
29+
Building a simple [ruby-sample-app](https://github.com/sclorg/s2i-ruby-container/tree/master/3.3/test/puma-test-app) application
3030
in Openshift can be achieved with the following step:
3131

3232
```
33-
oc new-app ruby:3.1~https://github.com/sclorg/rails-ex.git
33+
oc new-app ruby:3.3~https://github.com/sclorg/rails-ex.git
3434
```
3535

3636
**Accessing the application:**
@@ -64,10 +64,10 @@ To use the Ruby image in a Dockerfile, follow these steps:
6464
#### 1. Pull a base builder image to build on
6565

6666
```
67-
podman pull ubi8/ruby-31
67+
podman pull ubi8/ruby-33
6868
```
6969

70-
An RHEL8 image `ubi8/ruby-31` is used in this example.
70+
An RHEL8 image `ubi8/ruby-33` is used in this example.
7171

7272
#### 2. Pull and application code
7373

@@ -85,11 +85,11 @@ This step usually consists of at least these parts:
8585
* installing the dependencies
8686
* setting the default command in the resulting image
8787

88-
For all these three parts, users can use the Source-to-Image scripts inside the image ([3.1.](#31-to-use-the-source-to-image-scripts-and-build-an-image-using-a-dockerfile-create-a-dockerfile-with-this-content)), or users can either setup all manually and use commands `ruby`, `bundle` and `rackup` explicitly in the Dockerfile ([3.2.](#32-to-use-your-own-setup-create-a-dockerfile-with-this-content))
88+
For all these three parts, users can use the Source-to-Image scripts inside the image ([3.3.](#33-to-use-the-source-to-image-scripts-and-build-an-image-using-a-dockerfile-create-a-dockerfile-with-this-content)), or users can either setup all manually and use commands `ruby`, `bundle` and `rackup` explicitly in the Dockerfile ([3.3.](#33-to-use-your-own-setup-create-a-dockerfile-with-this-content))
8989

90-
##### 3.1 To use the Source-to-Image scripts and build an image using a Dockerfile, create a Dockerfile with this content:
90+
##### 3.3 To use the Source-to-Image scripts and build an image using a Dockerfile, create a Dockerfile with this content:
9191
```
92-
FROM ubi8/ruby-31
92+
FROM ubi8/ruby-33
9393
9494
# Add application sources to a directory that the assemble scriptexpects them
9595
# and set permissions so that the container runs without root access
@@ -108,9 +108,9 @@ RUN /usr/libexec/s2i/assemble
108108
CMD /usr/libexec/s2i/run
109109
```
110110
The s2i scripts are used to set-up and run common Ruby applications. More information about the scripts can be found in [Source-to-Image](#source-to-image-framework-and-scripts) section.
111-
##### 3.2 To use your own setup, create a Dockerfile with this content:
111+
##### 3.3 To use your own setup, create a Dockerfile with this content:
112112
```
113-
FROM ubi8/ruby-31
113+
FROM ubi8/ruby-33
114114
115115
USER 0
116116
ADD app-src ./

Diff for: Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Variables are documented in common/build.sh.
22
BASE_IMAGE_NAME = ruby
3-
VERSIONS = 2.5 3.0 3.1
3+
VERSIONS = 2.5 3.0 3.1 3.3
44
OPENSHIFT_NAMESPACES = 2.0
55
CONU_IMAGE := docker.io/usercont/conu:0.6.2
66

0 commit comments

Comments
 (0)