From b49f45f5a2be67d554949268318266e0caa881c5 Mon Sep 17 00:00:00 2001 From: Tim Kuntz Date: Thu, 4 Apr 2024 11:42:13 -0500 Subject: [PATCH 1/2] Fix Rails 5.2 Docker image 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: https://github.com/github/pages-gem/issues/839 --- meta_request/Dockerfile-rails-5.2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meta_request/Dockerfile-rails-5.2 b/meta_request/Dockerfile-rails-5.2 index 3814ea0..4eed66e 100644 --- a/meta_request/Dockerfile-rails-5.2 +++ b/meta_request/Dockerfile-rails-5.2 @@ -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 \ @@ -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 . From 8457cfd30680e4a2ed8c8838f91427d5c03ff70b Mon Sep 17 00:00:00 2001 From: Tim Kuntz Date: Thu, 4 Apr 2024 12:31:11 -0500 Subject: [PATCH 2/2] Fix Rails 6.x Docker images --- meta_request/Dockerfile-rails-6.0 | 3 ++- meta_request/Dockerfile-rails-6.1 | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/meta_request/Dockerfile-rails-6.0 b/meta_request/Dockerfile-rails-6.0 index 5205b8c..d301567 100644 --- a/meta_request/Dockerfile-rails-6.0 +++ b/meta_request/Dockerfile-rails-6.0 @@ -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 \ @@ -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 6.0.6 RUN rails new . diff --git a/meta_request/Dockerfile-rails-6.1 b/meta_request/Dockerfile-rails-6.1 index 7475cef..731e2d9 100644 --- a/meta_request/Dockerfile-rails-6.1 +++ b/meta_request/Dockerfile-rails-6.1 @@ -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 \ @@ -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 6.1.7 RUN rails new .