Skip to content

Commit

Permalink
Fix Rails 5.2 Docker image
Browse files Browse the repository at this point in the history
There were 2 issues that were breaking the build and tests.

1. Updating Ruby Gems itself without specifying a version causes it to
   update to the latest version which requires Ruby 3. Instead, we
   specify the latest version compatible with Ruby 2.6.

Compatibility versions found here:
https://rubygems.org/api/v1/versions/rubygems-update.json

2. The version of Alpine Linux shipping with the Ruby 2.6 image is
   missing a shared library needed to load nokogiri. Adding `gcompat`
   corrects this.

More information found here:
github/pages-gem#839
  • Loading branch information
tim-kuntz committed Apr 4, 2024
1 parent de081f7 commit b49f45f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion meta_request/Dockerfile-rails-5.2
Expand Up @@ -3,6 +3,7 @@ FROM ruby:2.6-alpine
RUN apk add --update --no-cache \
build-base \
curl-dev \
gcompat \
git \
nodejs \
shared-mime-info \
Expand All @@ -15,7 +16,7 @@ RUN apk add --update --no-cache \
RUN mkdir /app /gem
WORKDIR /app

RUN gem update --system
RUN gem update --system 3.4.22
RUN gem install rails -v 5.2.3
RUN rails new .

Expand Down

0 comments on commit b49f45f

Please sign in to comment.