Skip to content

Commit

Permalink
amazonlinux build with Ruby 3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Ithanil committed Dec 13, 2024
1 parent 0e3cee0 commit 09e6088
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
1 change: 0 additions & 1 deletion .ruby-version

This file was deleted.

2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '>= 3.3'
ruby file: '>= 3.3'

gem 'active_model_serializers', '>= 0.10.15'
gem 'active_storage_validations', '>= 1.3.4'
Expand Down
23 changes: 14 additions & 9 deletions dockerfiles/v3/amazonlinux
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM amazonlinux:2 AS amazonlinux
SHELL ["/bin/bash", "-c"]

ARG RAILS_ROOT=/usr/src/app
ENV RAILS_ROOT=${RAILS_ROOT}
Expand All @@ -18,20 +19,24 @@ WORKDIR $RAILS_ROOT
# Install Node.js (needed for yarn)
RUN curl -sL https://rpm.nodesource.com/setup_16.x | bash -
RUN yum -y install nodejs
RUN yum -y install yarn gcc-c++ make
RUN yum -y install yarn gcc-c++ make libyaml-devel libffi-devel glibc-devel readline-devel openssl-devel

# Install Ruby & Rails
# Install basic packages
RUN curl -sL -o /etc/yum.repos.d/yarn.repo https://dl.yarnpkg.com/rpm/yarn.repo
RUN amazon-linux-extras enable ruby3.0

RUN yum -y install git tar gzip yarn shared-mime-info libxslt zlib-devel ruby-devel rubygems-devel rubygem-bundler rubygem-io-console rubygem-irb rubygem-json rubygem-minitest rubygem-net-http-persistent rubygem-net-telnet rubygem-power_assert rubygem-rake rubygem-test-unit rubygem-thor rubygem-xmlrpc rubygem-bigdecimal
RUN yum -y install python3 python3-pip shadow-utils
RUN gem install rails

RUN yum -y install git tar gzip yarn shared-mime-info libxslt zlib-devel python3 python3-pip shadow-utils python3 python3-pip shadow-utils
RUN amazon-linux-extras install postgresql13
RUN yum -y install postgresql-devel

RUN amazon-linux-extras list | grep ruby
# Install Ruby & Rails
RUN git clone https://github.com/rbenv/rbenv.git /root/.rbenv && \
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> /root/.bashrc && \
echo 'eval "$(rbenv init -)"' >> /root/.bashrc && \
git clone https://github.com/rbenv/ruby-build.git /root/.rbenv/plugins/ruby-build && \
/root/.rbenv/bin/rbenv install 3.3.6 && \
/root/.rbenv/bin/rbenv global 3.3.6 && \
/root/.rbenv/bin/rbenv rehash
ENV PATH="/root/.rbenv/shims:/root/.rbenv/bin:$PATH"
RUN gem install bundler -v '~> 2.5'

COPY . ./
RUN bundle install -j4 \
Expand Down

0 comments on commit 09e6088

Please sign in to comment.