Skip to content

Instantly share code, notes, and snippets.

@cjjavellana
Last active July 24, 2023 14:38
Show Gist options
  • Save cjjavellana/a8d7f4d68601db7c23c8f663be8b275b to your computer and use it in GitHub Desktop.
Save cjjavellana/a8d7f4d68601db7c23c8f663be8b275b to your computer and use it in GitHub Desktop.
Building Ruby 3.2.2 from source
FROM redhat/ubi8:latest
RUN yum install -y make gcc wget zlib perl
RUN cd /tmp && \
wget https://cache.ruby-lang.org/pub/ruby/3.2/ruby-3.2.2.tar.gz && \
wget https://github.com/yaml/libyaml/releases/download/0.2.5/yaml-0.2.5.tar.gz && \
wget https://github.com/openssl/openssl/releases/download/OpenSSL_1_1_1u/openssl-1.1.1u.tar.gz && \
wget https://github.com/libffi/libffi/releases/download/v3.4.4/libffi-3.4.4.tar.gz && \
tar xzvf ruby-3.2.2.tar.gz && \
tar xzvf yaml-0.2.5.tar.gz && \
tar xzvf openssl-1.1.1u.tar.gz && \
tar xzvf libffi-3.4.4.tar.gz
RUN cd /tmp/openssl-1.1.1u && \
./config --prefix=/tmp/openssl && \
make && \
make install
RUN cd /tmp/ruby-3.2.2 && \
./configure --prefix=/opt/ruby-3.2.2 --with-libyaml-source-dir=/tmp/yaml-0.2.5 --with-openssl-dir=/tmp/openssl --with-libffi-dir=/tmp/libffi-3.4.4 && \
make && make install
WORKDIR /opt/ruby-3.2.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment