From 3ac2a75167c3fe80b9f794ffce014dee4d43cfb9 Mon Sep 17 00:00:00 2001 From: Ryan Hughes Date: Sun, 7 Sep 2025 23:25:14 +0200 Subject: [PATCH] Quick and dirty ruby build --- build/Dockerfile.ruby | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 build/Dockerfile.ruby diff --git a/build/Dockerfile.ruby b/build/Dockerfile.ruby new file mode 100644 index 0000000..3e3ede8 --- /dev/null +++ b/build/Dockerfile.ruby @@ -0,0 +1,33 @@ +FROM archlinux:base-devel + +# Update packages and install dependencies for mise and Ruby compilation +RUN pacman -Syu --noconfirm --needed git curl sudo ca-certificates openssl zlib libyaml libffi readline ncurses base-devel \ + && pacman -Scc --noconfirm + +# Set mise environment variables for a consistent, container-friendly path +ENV MISE_DATA_DIR=/mise +ENV MISE_CONFIG_DIR=/mise +ENV MISE_CACHE_DIR=/mise/cache +ENV MISE_INSTALL_PATH=/usr/local/bin/mise +ENV PATH=/mise/shims:$PATH + +# Install mise +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +RUN curl https://mise.run | sh + +# Set Ruby build options for relocatable/portable compilation +ENV MISE_RUBY_BUILD_OPTS="--enable-load-relative --with-static-linked-ext" + +# Install Ruby 3.4.5 +RUN mise install ruby@3.4.5 + +# Activate Ruby and install Rails +RUN mise use ruby@3.4.5 +RUN gem install rails --version 8.0.2.1 + +# Generate a temporary Rails app to install default gems +RUN rails new temp_app \ + && rm -rf temp_app + +# Create a single tarball with Ruby and all gems +RUN tar -czf /ruby-3.4.5-rails-8.0.2.1.tar.gz -C /mise/installs/ruby 3.4.5