Install ruby 3.0.4

This commit is contained in:
Girish Ramakrishnan 2022-11-14 22:31:10 +01:00
parent 2c26a2b9e3
commit d0a8585230

View file

@ -12,6 +12,16 @@ RUN apt-get update && \
libidn11-dev libicu-dev libjemalloc-dev && \ libidn11-dev libicu-dev libjemalloc-dev && \
rm -rf /var/cache/apt /var/lib/apt/lists rm -rf /var/cache/apt /var/lib/apt/lists
# install rbenv since we need ruby 3.0.4
RUN mkdir -p /usr/local/rbenv && curl -LSs "https://github.com/rbenv/rbenv/archive/refs/tags/v1.2.0.tar.gz" | tar -xz -C /usr/local/rbenv --strip-components 1 -f -
ENV PATH /usr/local/rbenv/bin:$PATH
RUN mkdir -p "$(rbenv root)"/plugins/ruby-build && curl -LSs "https://github.com/rbenv/ruby-build/archive/refs/tags/v20221101.tar.gz" | tar -xz -C "$(rbenv root)"/plugins/ruby-build --strip-components 1 -f -
# install specific ruby version (https://github.com/mastodon/mastodon/blob/main/Dockerfile)
ARG RUBY_VERSION=3.0.4
RUN rbenv install ${RUBY_VERSION}
ENV PATH /root/.rbenv/versions/${RUBY_VERSION}/bin:$PATH
RUN gem install --no-document bundler RUN gem install --no-document bundler
ENV RAILS_ENV production ENV RAILS_ENV production