Skip to content

Commit

Permalink
Merge pull request #81 from ruby/cleanup-baseruby
Browse files Browse the repository at this point in the history
Use /root directory to install BASERUBY
  • Loading branch information
hsbt authored Feb 22, 2024
2 parents bb8c1de + 91a3d89 commit 91e3352
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ COPY tmp/ruby /usr/src/ruby
COPY install_ruby.sh /tmp/

RUN set -ex && \
RUBY_VERSION=3.2.3 /tmp/install_ruby.sh
RUBY_VERSION=3.2.3 PREFIX=/root /tmp/install_ruby.sh
RUN apt purge -y --auto-remove ruby
COPY tmp/ruby /usr/src/ruby

Expand All @@ -66,8 +66,7 @@ RUN set -ex && \
echo 'update: --no-document'; \
} >> /usr/local/etc/gemrc && \
\
/tmp/install_ruby.sh

PATH=/root/bin:$PATH /tmp/install_ruby.sh

### ruby ###
FROM ubuntu:$BASE_IMAGE_TAG AS ruby
Expand Down
4 changes: 3 additions & 1 deletion install_ruby.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ set -ex
RUBY_VERSION=${RUBY_VERSION-2.6.0}
RUBY_MAJOR=$(echo $RUBY_VERSION | sed -E 's/\.[0-9]+(-.*)?$//g')
RUBYGEMS_VERSION=${RUBYGEMS_VERSION-3.2.3}
PREFIX=${PREFIX-/usr/local}

function get_released_ruby() {
git clone --depth 1 https://github.com/ruby/www.ruby-lang.org.git /tmp/www
Expand Down Expand Up @@ -83,7 +84,7 @@ fi
gnuArch=$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)
configure_args=( \
--build="$gnuArch" \
--prefix=/usr/local \
--prefix="$PREFIX" \
--disable-install-doc \
--enable-shared \
--enable-yjit
Expand Down Expand Up @@ -122,4 +123,5 @@ fi
rm -fr /usr/src/ruby /root/.gem/

# rough smoke test
export PATH=$PREFIX/bin:$PATH
(cd && ruby --version && gem --version && bundle --version)

0 comments on commit 91e3352

Please sign in to comment.