From 97d1e3a462f2e8a22636cc90f7337e03e291b17b Mon Sep 17 00:00:00 2001 From: Tim Kuntz Date: Thu, 4 Apr 2024 14:43:36 -0500 Subject: [PATCH] Fix the Docker build errors 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 the installed Ruby. Compatibility versions found here: https://rubygems.org/api/v1/versions/rubygems-update.json 2. All builds were having issues with missing shared libraries. In the case of the Ruby 2.6 images it was nokogiri and for the Ruby 3.0 image it was sqlite3. A common fix for all the builds was to configure Bundler to consider the platform during dependency resolution. More information found here: https://bundler.io/v1.14/whats_new.html https://github.com/sparklemotion/sqlite3-ruby/issues/434 https://github.com/github/pages-gem/issues/839 - alt. fix for Ruby 2.6 --- meta_request/Dockerfile-rails-5.2 | 3 ++- meta_request/Dockerfile-rails-6.0 | 3 ++- meta_request/Dockerfile-rails-6.1 | 3 ++- meta_request/Dockerfile-rails-7.0 | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/meta_request/Dockerfile-rails-5.2 b/meta_request/Dockerfile-rails-5.2 index 3814ea0..5dff8b3 100644 --- a/meta_request/Dockerfile-rails-5.2 +++ b/meta_request/Dockerfile-rails-5.2 @@ -15,7 +15,8 @@ RUN apk add --update --no-cache \ RUN mkdir /app /gem WORKDIR /app -RUN gem update --system +RUN gem update --system 3.4.22 +RUN bundle config force_ruby_platform true RUN gem install rails -v 5.2.3 RUN rails new . diff --git a/meta_request/Dockerfile-rails-6.0 b/meta_request/Dockerfile-rails-6.0 index 5205b8c..09f3227 100644 --- a/meta_request/Dockerfile-rails-6.0 +++ b/meta_request/Dockerfile-rails-6.0 @@ -15,7 +15,8 @@ RUN apk add --update --no-cache \ RUN mkdir /app /gem WORKDIR /app -RUN gem update --system +RUN gem update --system 3.4.22 +RUN bundle config force_ruby_platform true 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..ffee39c 100644 --- a/meta_request/Dockerfile-rails-6.1 +++ b/meta_request/Dockerfile-rails-6.1 @@ -15,7 +15,8 @@ RUN apk add --update --no-cache \ RUN mkdir /app /gem WORKDIR /app -RUN gem update --system +RUN gem update --system 3.4.22 +RUN bundle config force_ruby_platform true RUN gem install rails -v 6.1.7 RUN rails new . diff --git a/meta_request/Dockerfile-rails-7.0 b/meta_request/Dockerfile-rails-7.0 index 864d42a..5df45da 100644 --- a/meta_request/Dockerfile-rails-7.0 +++ b/meta_request/Dockerfile-rails-7.0 @@ -15,7 +15,8 @@ RUN apk add --update --no-cache \ RUN mkdir /app /gem WORKDIR /app -RUN gem update --system +RUN gem update --system 3.5.7 +RUN bundle config force_ruby_platform true RUN gem install rails -v 7.0.4 RUN rails new .