Skip to content

Commit

Permalink
feat: install Ruby runtime environment
Browse files Browse the repository at this point in the history
- Ruby v3.3.5 (default)
- Ruby v3.2.5 (only on: amd64 and arm64/v8)
- Ruby v3.1.6 (only on: amd64 and arm64/v8)

Signed-off-by: Stephan Linz <[email protected]>
  • Loading branch information
rexut committed Oct 25, 2024
1 parent ce56e9c commit 0aafba2
Show file tree
Hide file tree
Showing 3 changed files with 293 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/stages.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
{ "stage": "python" },
{ "stage": "golang", "ghr-free-disk": true },
{ "stage": "nodejs", "ghr-free-disk": true },
{ "stage": "ruby", "ghr-free-disk": true },
{ "stage": "push", "ghr-free-disk": true }
]
}
287 changes: 287 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -1689,3 +1689,290 @@ FROM nodejs-${TARGETARCH} AS nodejs

# Adding labels for external usage
LABEL nodejs.version=$TSN_ASDF_NODEJS_VERSION


# ________________________________
# ____
# / ) /
# ---/___ /------------/__--------
# / | / / / ) / /
# _/_____|___(___(___(___/__(___/_
# /
# (_ /

# ############################################################################
# ┏┓┓ ┓
# All architectures maintenance Ruby runtime environments ┣┫┃ ┃
# ┛┗┗┛┗┛
# ############################################################################

FROM nodejs AS ruby-all

#
# Ruby runtime versions
# https://www.ruby-lang.org/en/downloads/branches
# https://www.ruby-lang.org/en/downloads/releases
# https://github.com/asdf-vm/asdf-ruby
# https://github.com/asdf-vm/asdf-ruby/commits
#

# Define Ruby versions to be installed via ASDF
ENV TSN_ASDF_RUBY_VERSION_33=3.3.5
ENV TSN_ASDF_RUBY_VERSION=$TSN_ASDF_RUBY_VERSION_33

# Define Ruby default behaviour for compilations (no documentation)
ENV RUBY_BUILD_OPTS="--verbose"
ENV RUBY_CONFIGURE_OPTS="--with-mantype=doc"
ENV RUBY_CONFIGURE_OPTS="$RUBY_CONFIGURE_OPTS --disable-install-doc"
ENV RUBY_CONFIGURE_OPTS="$RUBY_CONFIGURE_OPTS --disable-install-rdoc"
ENV RUBY_CONFIGURE_OPTS="$RUBY_CONFIGURE_OPTS --disable-install-capi"

# Define Ruby default behaviour for compilations (JIT compiler with Ruby)
# - https://docs.ruby-lang.org/en/master/rjit/rjit_md.html
ENV RUBY_CONFIGURE_OPTS="$RUBY_CONFIGURE_OPTS --enable-rjit"

# ############################################################################
#
# AMD/x86 64-bit architecture maintenance for /||\/||\ / /|
# Ruby runtime environments /-|| ||/(_)~|~
#
# ############################################################################

FROM ruby-all AS ruby-amd64

# Define Ruby versions to be installed via ASDF
ENV TSN_ASDF_RUBY_VERSION_31=3.1.6
ENV TSN_ASDF_RUBY_VERSION_32=3.2.5

# Define Ruby default behaviour for compilations (JIT compiler with Rust)
# - https://docs.ruby-lang.org/en/master/yjit/yjit_md.html
ENV RUBY_CONFIGURE_OPTS="$RUBY_CONFIGURE_OPTS --enable-yjit"

# ############################################################################

# Install Ruby versions and set default version
RUN asdf install ruby $TSN_ASDF_RUBY_VERSION_31 \
&& asdf global ruby $TSN_ASDF_RUBY_VERSION_31 \
&& asdf reshim ruby \
\
&& asdf install ruby $TSN_ASDF_RUBY_VERSION_32 \
&& asdf global ruby $TSN_ASDF_RUBY_VERSION_32 \
&& asdf reshim ruby \
\
&& asdf install ruby $TSN_ASDF_RUBY_VERSION_33 \
&& asdf global ruby $TSN_ASDF_RUBY_VERSION_33 \
&& asdf reshim ruby \
\
&& asdf local ruby $TSN_ASDF_RUBY_VERSION \
&& asdf list ruby \
\
&& bundle --version \
&& bundler --version \
&& erb --version \
&& irb --version \
&& racc --version \
&& rake --version \
&& rbs --version \
&& rdbg --version \
&& rdoc --version \
&& ri --version \
&& ruby --version \
&& gem --version \
&& gem list

# ############################################################################

# Adding labels for external usage
LABEL ruby.version_31=$TSN_ASDF_RUBY_VERSION_31
LABEL ruby.version_32=$TSN_ASDF_RUBY_VERSION_32

# ############################################################################
#
# ARMv7 32-bit architecture maintenance for /||)|\/|
# Ruby runtime environments /-||\| |
#
# ############################################################################

FROM ruby-all AS ruby-arm

# Install Ruby versions and set default version
RUN asdf install ruby $TSN_ASDF_RUBY_VERSION \
&& asdf global ruby $TSN_ASDF_RUBY_VERSION \
&& asdf reshim ruby \
\
&& asdf local ruby $TSN_ASDF_RUBY_VERSION \
&& asdf list ruby \
\
&& bundle --version \
&& bundler --version \
&& erb --version \
&& irb --version \
&& racc --version \
&& rake --version \
&& rbs --version \
&& rdbg --version \
&& rdoc --version \
&& ri --version \
&& ruby --version \
&& gem --version \
&& gem list

# ############################################################################
#
# ARMv8 64-bit architecture maintenance for /||)|\/| / /|
# Ruby runtime environments /-||\| |(_)~|~
#
# ############################################################################

FROM ruby-all AS ruby-arm64

# Define Ruby versions to be installed via ASDF
ENV TSN_ASDF_RUBY_VERSION_31=3.1.6
ENV TSN_ASDF_RUBY_VERSION_32=3.2.5

# Define Ruby default behaviour for compilations (JIT compiler with Rust)
# - https://docs.ruby-lang.org/en/master/yjit/yjit_md.html
ENV RUBY_CONFIGURE_OPTS="$RUBY_CONFIGURE_OPTS --enable-yjit"

# ############################################################################

# Install Ruby versions and set default version
RUN asdf install ruby $TSN_ASDF_RUBY_VERSION_31 \
&& asdf global ruby $TSN_ASDF_RUBY_VERSION_31 \
&& asdf reshim ruby \
\
&& asdf install ruby $TSN_ASDF_RUBY_VERSION_32 \
&& asdf global ruby $TSN_ASDF_RUBY_VERSION_32 \
&& asdf reshim ruby \
\
&& asdf install ruby $TSN_ASDF_RUBY_VERSION_33 \
&& asdf global ruby $TSN_ASDF_RUBY_VERSION_33 \
&& asdf reshim ruby \
\
&& asdf local ruby $TSN_ASDF_RUBY_VERSION \
&& asdf list ruby \
\
&& bundle --version \
&& bundler --version \
&& erb --version \
&& irb --version \
&& racc --version \
&& rake --version \
&& rbs --version \
&& rdbg --version \
&& rdoc --version \
&& ri --version \
&& ruby --version \
&& gem --version \
&& gem list

# ############################################################################

# Adding labels for external usage
LABEL ruby.version_31=$TSN_ASDF_RUBY_VERSION_31
LABEL ruby.version_32=$TSN_ASDF_RUBY_VERSION_32

# ############################################################################
#
# RISC-V 64-bit architecture maintenance for |)|(`/`| // /|
# Ruby runtime environments |\|_)\,|/(_)~|~
#
# ############################################################################

FROM ruby-all AS ruby-riscv64

# Install Ruby versions and set default version
RUN asdf install ruby $TSN_ASDF_RUBY_VERSION \
&& asdf global ruby $TSN_ASDF_RUBY_VERSION \
&& asdf reshim ruby \
\
&& asdf local ruby $TSN_ASDF_RUBY_VERSION \
&& asdf list ruby \
\
&& bundle --version \
&& bundler --version \
&& erb --version \
&& irb --version \
&& racc --version \
&& rake --version \
&& rbs --version \
&& rdbg --version \
&& rdoc --version \
&& ri --version \
&& ruby --version \
&& gem --version \
&& gem list

# ############################################################################
#
# IBM POWER8 architecture maintenance for |)|)/` / /| | [~
# Ruby runtime environments | | \,(_)~|~|_[_
#
# ############################################################################

FROM ruby-all AS ruby-ppc64le

# Install Ruby versions and set default version
RUN asdf install ruby $TSN_ASDF_RUBY_VERSION \
&& asdf global ruby $TSN_ASDF_RUBY_VERSION \
&& asdf reshim ruby \
\
&& asdf local ruby $TSN_ASDF_RUBY_VERSION \
&& asdf list ruby \
\
&& bundle --version \
&& bundler --version \
&& erb --version \
&& irb --version \
&& racc --version \
&& rake --version \
&& rbs --version \
&& rdbg --version \
&& rdoc --version \
&& ri --version \
&& ruby --version \
&& gem --version \
&& gem list

# ############################################################################
#
# IBM z-Systems architecture maintenance for (`')(~)/\\/
# Ruby runtime environments _).) / \//\
#
# ############################################################################

FROM ruby-all AS ruby-s390x

# Install Ruby versions and set default version
RUN asdf install ruby $TSN_ASDF_RUBY_VERSION \
&& asdf global ruby $TSN_ASDF_RUBY_VERSION \
&& asdf reshim ruby \
\
&& asdf local ruby $TSN_ASDF_RUBY_VERSION \
&& asdf list ruby \
\
&& bundle --version \
&& bundler --version \
&& erb --version \
&& irb --version \
&& racc --version \
&& rake --version \
&& rbs --version \
&& rdbg --version \
&& rdoc --version \
&& ri --version \
&& ruby --version \
&& gem --version \
&& gem list

# ############################################################################
# ┏┓┳┳┓┏┓┓
# Final maintenance for Ruby runtime environments ┣ ┃┃┃┣┫┃
# ┻ ┻┛┗┛┗┗┛
# ############################################################################

FROM ruby-${TARGETARCH} AS ruby

# Adding labels for external usage
LABEL ruby.version_33=$TSN_ASDF_RUBY_VERSION_33
LABEL ruby.version=$TSN_ASDF_RUBY_VERSION
5 changes: 5 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,11 @@ Multiple runtime environments

"x", "**18.19.1**", "| ``TSN_ASDF_NODEJS_VERSION``
| ``TSN_ASDF_NODEJS_VERSION_18``", " ", " ", " ", "#", " ", " "
" ", "|Ruby|_:", "|", " ", " ", " ", " ", " ", " "
" ", "**3.3.5**", "| ``TSN_ASDF_RUBY_VERSION``
| ``TSN_ASDF_RUBY_VERSION_33``", "x", "x", "x", "x", "x", "x"
" ", "*3.2.5*", "| ``TSN_ASDF_RUBY_VERSION_32``", "x", " ", "x", " ", " ", " "
" ", "*3.1.6*", "| ``TSN_ASDF_RUBY_VERSION_31``", "x", " ", "x", " ", " ", " "

.. [*] Default version (bold).
Expand Down

0 comments on commit 0aafba2

Please sign in to comment.