From 84db4691c080384c8fbce44c722d46cedd6a384b Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Mon, 31 Dec 2018 16:59:56 -0800 Subject: [PATCH] Adjust RUBYGEMS_VERSION to be fixed at either 3.0.1 or the Ruby-bundled version, whichever is newer This also adjusts Bundler to be explicitly fixed at either 1.17.2 or the Ruby/Rubygems-bundled version, whichever is newer -- this is slightly older than what we've already pushed (1.17.3), but nothing in the changelog appears to be relevant, so this seems fine: https://github.com/bundler/bundler/compare/v1.17.2...v1.17.3#diff-4ac32a78649ca5bdd8e0ba38b7006a1e For Ruby 2.6, this means we no longer do anything to the bundled Rubygems (or Bundler), and simply provide whatever comes with the Ruby release as-is, and it is now up to users to explicitly update if they need a newer version than is provided here. --- 2.3/alpine3.7/Dockerfile | 12 ++++++------ 2.3/alpine3.8/Dockerfile | 12 ++++++------ 2.3/jessie/Dockerfile | 12 ++++++------ 2.3/jessie/slim/Dockerfile | 12 ++++++------ 2.3/stretch/Dockerfile | 12 ++++++------ 2.3/stretch/slim/Dockerfile | 12 ++++++------ 2.4/alpine3.7/Dockerfile | 12 ++++++------ 2.4/alpine3.8/Dockerfile | 12 ++++++------ 2.4/jessie/Dockerfile | 12 ++++++------ 2.4/jessie/slim/Dockerfile | 12 ++++++------ 2.4/stretch/Dockerfile | 12 ++++++------ 2.4/stretch/slim/Dockerfile | 12 ++++++------ 2.5/alpine3.7/Dockerfile | 12 ++++++------ 2.5/alpine3.8/Dockerfile | 12 ++++++------ 2.5/stretch/Dockerfile | 12 ++++++------ 2.5/stretch/slim/Dockerfile | 12 ++++++------ 2.6/alpine3.7/Dockerfile | 8 ++------ 2.6/alpine3.8/Dockerfile | 8 ++------ 2.6/stretch/Dockerfile | 8 ++------ 2.6/stretch/slim/Dockerfile | 8 ++------ Dockerfile-alpine.template | 10 +++++----- Dockerfile-debian.template | 10 +++++----- Dockerfile-slim.template | 10 +++++----- update.sh | 15 +++++++++++---- 24 files changed, 130 insertions(+), 139 deletions(-) diff --git a/2.3/alpine3.7/Dockerfile b/2.3/alpine3.7/Dockerfile index 8005b2a15..04fd51e76 100644 --- a/2.3/alpine3.7/Dockerfile +++ b/2.3/alpine3.7/Dockerfile @@ -10,8 +10,7 @@ RUN mkdir -p /usr/local/etc \ ENV RUBY_MAJOR 2.3 ENV RUBY_VERSION 2.3.8 ENV RUBY_DOWNLOAD_SHA256 910f635d84fd0d81ac9bdee0731279e6026cb4cd1315bbbb5dfb22e09c5c1dfe -ENV RUBYGEMS_VERSION 3.0.2 -ENV BUNDLER_VERSION 2.0.1 +ENV RUBYGEMS_VERSION 3.0.1 # some of ruby's build scripts are written in ruby # we purge system ruby later to make sure our final image uses what we just built @@ -99,10 +98,11 @@ RUN set -ex \ && apk del --no-network .ruby-builddeps \ && cd / \ && rm -r /usr/src/ruby \ - \ - && gem update --system "$RUBYGEMS_VERSION" \ - && gem install bundler --version "$BUNDLER_VERSION" --force \ - && rm -r /root/.gem/ +# make sure bundled "rubygems" is older than RUBYGEMS_VERSION (https://github.com/docker-library/ruby/issues/246) + && ruby -e 'exit(Gem::Version.create(ENV["RUBYGEMS_VERSION"]) > Gem::Version.create(Gem::VERSION))' \ + && gem update --system "$RUBYGEMS_VERSION" && rm -r /root/.gem/ \ +# rough smoke test + && ruby --version && gem --version && bundle --version # install things globally, for great justice # and don't create ".bundle" in all our apps diff --git a/2.3/alpine3.8/Dockerfile b/2.3/alpine3.8/Dockerfile index 934b2625b..202caa1ff 100644 --- a/2.3/alpine3.8/Dockerfile +++ b/2.3/alpine3.8/Dockerfile @@ -10,8 +10,7 @@ RUN mkdir -p /usr/local/etc \ ENV RUBY_MAJOR 2.3 ENV RUBY_VERSION 2.3.8 ENV RUBY_DOWNLOAD_SHA256 910f635d84fd0d81ac9bdee0731279e6026cb4cd1315bbbb5dfb22e09c5c1dfe -ENV RUBYGEMS_VERSION 3.0.2 -ENV BUNDLER_VERSION 2.0.1 +ENV RUBYGEMS_VERSION 3.0.1 # some of ruby's build scripts are written in ruby # we purge system ruby later to make sure our final image uses what we just built @@ -99,10 +98,11 @@ RUN set -ex \ && apk del --no-network .ruby-builddeps \ && cd / \ && rm -r /usr/src/ruby \ - \ - && gem update --system "$RUBYGEMS_VERSION" \ - && gem install bundler --version "$BUNDLER_VERSION" --force \ - && rm -r /root/.gem/ +# make sure bundled "rubygems" is older than RUBYGEMS_VERSION (https://github.com/docker-library/ruby/issues/246) + && ruby -e 'exit(Gem::Version.create(ENV["RUBYGEMS_VERSION"]) > Gem::Version.create(Gem::VERSION))' \ + && gem update --system "$RUBYGEMS_VERSION" && rm -r /root/.gem/ \ +# rough smoke test + && ruby --version && gem --version && bundle --version # install things globally, for great justice # and don't create ".bundle" in all our apps diff --git a/2.3/jessie/Dockerfile b/2.3/jessie/Dockerfile index 65aee4954..50b813f00 100644 --- a/2.3/jessie/Dockerfile +++ b/2.3/jessie/Dockerfile @@ -10,8 +10,7 @@ RUN mkdir -p /usr/local/etc \ ENV RUBY_MAJOR 2.3 ENV RUBY_VERSION 2.3.8 ENV RUBY_DOWNLOAD_SHA256 910f635d84fd0d81ac9bdee0731279e6026cb4cd1315bbbb5dfb22e09c5c1dfe -ENV RUBYGEMS_VERSION 3.0.2 -ENV BUNDLER_VERSION 2.0.1 +ENV RUBYGEMS_VERSION 3.0.1 # some of ruby's build scripts are written in ruby # we purge system ruby later to make sure our final image uses what we just built @@ -57,10 +56,11 @@ RUN set -ex \ && apt-get purge -y --auto-remove $buildDeps \ && cd / \ && rm -r /usr/src/ruby \ - \ - && gem update --system "$RUBYGEMS_VERSION" \ - && gem install bundler --version "$BUNDLER_VERSION" --force \ - && rm -r /root/.gem/ +# make sure bundled "rubygems" is older than RUBYGEMS_VERSION (https://github.com/docker-library/ruby/issues/246) + && ruby -e 'exit(Gem::Version.create(ENV["RUBYGEMS_VERSION"]) > Gem::Version.create(Gem::VERSION))' \ + && gem update --system "$RUBYGEMS_VERSION" && rm -r /root/.gem/ \ +# rough smoke test + && ruby --version && gem --version && bundle --version # install things globally, for great justice # and don't create ".bundle" in all our apps diff --git a/2.3/jessie/slim/Dockerfile b/2.3/jessie/slim/Dockerfile index d7c60bc77..ea4b0a9d0 100644 --- a/2.3/jessie/slim/Dockerfile +++ b/2.3/jessie/slim/Dockerfile @@ -22,8 +22,7 @@ RUN mkdir -p /usr/local/etc \ ENV RUBY_MAJOR 2.3 ENV RUBY_VERSION 2.3.8 ENV RUBY_DOWNLOAD_SHA256 910f635d84fd0d81ac9bdee0731279e6026cb4cd1315bbbb5dfb22e09c5c1dfe -ENV RUBYGEMS_VERSION 3.0.2 -ENV BUNDLER_VERSION 2.0.1 +ENV RUBYGEMS_VERSION 3.0.1 # some of ruby's build scripts are written in ruby # we purge system ruby later to make sure our final image uses what we just built @@ -83,10 +82,11 @@ RUN set -ex \ && apt-get purge -y --auto-remove $buildDeps \ && cd / \ && rm -r /usr/src/ruby \ - \ - && gem update --system "$RUBYGEMS_VERSION" \ - && gem install bundler --version "$BUNDLER_VERSION" --force \ - && rm -r /root/.gem/ +# make sure bundled "rubygems" is older than RUBYGEMS_VERSION (https://github.com/docker-library/ruby/issues/246) + && ruby -e 'exit(Gem::Version.create(ENV["RUBYGEMS_VERSION"]) > Gem::Version.create(Gem::VERSION))' \ + && gem update --system "$RUBYGEMS_VERSION" && rm -r /root/.gem/ \ +# rough smoke test + && ruby --version && gem --version && bundle --version # install things globally, for great justice # and don't create ".bundle" in all our apps diff --git a/2.3/stretch/Dockerfile b/2.3/stretch/Dockerfile index 9e3552b55..628f4f5b3 100644 --- a/2.3/stretch/Dockerfile +++ b/2.3/stretch/Dockerfile @@ -10,8 +10,7 @@ RUN mkdir -p /usr/local/etc \ ENV RUBY_MAJOR 2.3 ENV RUBY_VERSION 2.3.8 ENV RUBY_DOWNLOAD_SHA256 910f635d84fd0d81ac9bdee0731279e6026cb4cd1315bbbb5dfb22e09c5c1dfe -ENV RUBYGEMS_VERSION 3.0.2 -ENV BUNDLER_VERSION 2.0.1 +ENV RUBYGEMS_VERSION 3.0.1 # some of ruby's build scripts are written in ruby # we purge system ruby later to make sure our final image uses what we just built @@ -59,10 +58,11 @@ RUN set -ex \ && apt-get purge -y --auto-remove $buildDeps \ && cd / \ && rm -r /usr/src/ruby \ - \ - && gem update --system "$RUBYGEMS_VERSION" \ - && gem install bundler --version "$BUNDLER_VERSION" --force \ - && rm -r /root/.gem/ +# make sure bundled "rubygems" is older than RUBYGEMS_VERSION (https://github.com/docker-library/ruby/issues/246) + && ruby -e 'exit(Gem::Version.create(ENV["RUBYGEMS_VERSION"]) > Gem::Version.create(Gem::VERSION))' \ + && gem update --system "$RUBYGEMS_VERSION" && rm -r /root/.gem/ \ +# rough smoke test + && ruby --version && gem --version && bundle --version # install things globally, for great justice # and don't create ".bundle" in all our apps diff --git a/2.3/stretch/slim/Dockerfile b/2.3/stretch/slim/Dockerfile index 432d6cfc5..c66127e5b 100644 --- a/2.3/stretch/slim/Dockerfile +++ b/2.3/stretch/slim/Dockerfile @@ -22,8 +22,7 @@ RUN mkdir -p /usr/local/etc \ ENV RUBY_MAJOR 2.3 ENV RUBY_VERSION 2.3.8 ENV RUBY_DOWNLOAD_SHA256 910f635d84fd0d81ac9bdee0731279e6026cb4cd1315bbbb5dfb22e09c5c1dfe -ENV RUBYGEMS_VERSION 3.0.2 -ENV BUNDLER_VERSION 2.0.1 +ENV RUBYGEMS_VERSION 3.0.1 # some of ruby's build scripts are written in ruby # we purge system ruby later to make sure our final image uses what we just built @@ -83,10 +82,11 @@ RUN set -ex \ && apt-get purge -y --auto-remove $buildDeps \ && cd / \ && rm -r /usr/src/ruby \ - \ - && gem update --system "$RUBYGEMS_VERSION" \ - && gem install bundler --version "$BUNDLER_VERSION" --force \ - && rm -r /root/.gem/ +# make sure bundled "rubygems" is older than RUBYGEMS_VERSION (https://github.com/docker-library/ruby/issues/246) + && ruby -e 'exit(Gem::Version.create(ENV["RUBYGEMS_VERSION"]) > Gem::Version.create(Gem::VERSION))' \ + && gem update --system "$RUBYGEMS_VERSION" && rm -r /root/.gem/ \ +# rough smoke test + && ruby --version && gem --version && bundle --version # install things globally, for great justice # and don't create ".bundle" in all our apps diff --git a/2.4/alpine3.7/Dockerfile b/2.4/alpine3.7/Dockerfile index 91d71449c..d2fb67ce1 100644 --- a/2.4/alpine3.7/Dockerfile +++ b/2.4/alpine3.7/Dockerfile @@ -10,8 +10,7 @@ RUN mkdir -p /usr/local/etc \ ENV RUBY_MAJOR 2.4 ENV RUBY_VERSION 2.4.5 ENV RUBY_DOWNLOAD_SHA256 2f0cdcce9989f63ef7c2939bdb17b1ef244c4f384d85b8531d60e73d8cc31eeb -ENV RUBYGEMS_VERSION 3.0.2 -ENV BUNDLER_VERSION 2.0.1 +ENV RUBYGEMS_VERSION 3.0.1 # some of ruby's build scripts are written in ruby # we purge system ruby later to make sure our final image uses what we just built @@ -99,10 +98,11 @@ RUN set -ex \ && apk del --no-network .ruby-builddeps \ && cd / \ && rm -r /usr/src/ruby \ - \ - && gem update --system "$RUBYGEMS_VERSION" \ - && gem install bundler --version "$BUNDLER_VERSION" --force \ - && rm -r /root/.gem/ +# make sure bundled "rubygems" is older than RUBYGEMS_VERSION (https://github.com/docker-library/ruby/issues/246) + && ruby -e 'exit(Gem::Version.create(ENV["RUBYGEMS_VERSION"]) > Gem::Version.create(Gem::VERSION))' \ + && gem update --system "$RUBYGEMS_VERSION" && rm -r /root/.gem/ \ +# rough smoke test + && ruby --version && gem --version && bundle --version # install things globally, for great justice # and don't create ".bundle" in all our apps diff --git a/2.4/alpine3.8/Dockerfile b/2.4/alpine3.8/Dockerfile index 4c5005021..b45e328aa 100644 --- a/2.4/alpine3.8/Dockerfile +++ b/2.4/alpine3.8/Dockerfile @@ -10,8 +10,7 @@ RUN mkdir -p /usr/local/etc \ ENV RUBY_MAJOR 2.4 ENV RUBY_VERSION 2.4.5 ENV RUBY_DOWNLOAD_SHA256 2f0cdcce9989f63ef7c2939bdb17b1ef244c4f384d85b8531d60e73d8cc31eeb -ENV RUBYGEMS_VERSION 3.0.2 -ENV BUNDLER_VERSION 2.0.1 +ENV RUBYGEMS_VERSION 3.0.1 # some of ruby's build scripts are written in ruby # we purge system ruby later to make sure our final image uses what we just built @@ -99,10 +98,11 @@ RUN set -ex \ && apk del --no-network .ruby-builddeps \ && cd / \ && rm -r /usr/src/ruby \ - \ - && gem update --system "$RUBYGEMS_VERSION" \ - && gem install bundler --version "$BUNDLER_VERSION" --force \ - && rm -r /root/.gem/ +# make sure bundled "rubygems" is older than RUBYGEMS_VERSION (https://github.com/docker-library/ruby/issues/246) + && ruby -e 'exit(Gem::Version.create(ENV["RUBYGEMS_VERSION"]) > Gem::Version.create(Gem::VERSION))' \ + && gem update --system "$RUBYGEMS_VERSION" && rm -r /root/.gem/ \ +# rough smoke test + && ruby --version && gem --version && bundle --version # install things globally, for great justice # and don't create ".bundle" in all our apps diff --git a/2.4/jessie/Dockerfile b/2.4/jessie/Dockerfile index 8c43a0107..a47cc2f85 100644 --- a/2.4/jessie/Dockerfile +++ b/2.4/jessie/Dockerfile @@ -10,8 +10,7 @@ RUN mkdir -p /usr/local/etc \ ENV RUBY_MAJOR 2.4 ENV RUBY_VERSION 2.4.5 ENV RUBY_DOWNLOAD_SHA256 2f0cdcce9989f63ef7c2939bdb17b1ef244c4f384d85b8531d60e73d8cc31eeb -ENV RUBYGEMS_VERSION 3.0.2 -ENV BUNDLER_VERSION 2.0.1 +ENV RUBYGEMS_VERSION 3.0.1 # some of ruby's build scripts are written in ruby # we purge system ruby later to make sure our final image uses what we just built @@ -57,10 +56,11 @@ RUN set -ex \ && apt-get purge -y --auto-remove $buildDeps \ && cd / \ && rm -r /usr/src/ruby \ - \ - && gem update --system "$RUBYGEMS_VERSION" \ - && gem install bundler --version "$BUNDLER_VERSION" --force \ - && rm -r /root/.gem/ +# make sure bundled "rubygems" is older than RUBYGEMS_VERSION (https://github.com/docker-library/ruby/issues/246) + && ruby -e 'exit(Gem::Version.create(ENV["RUBYGEMS_VERSION"]) > Gem::Version.create(Gem::VERSION))' \ + && gem update --system "$RUBYGEMS_VERSION" && rm -r /root/.gem/ \ +# rough smoke test + && ruby --version && gem --version && bundle --version # install things globally, for great justice # and don't create ".bundle" in all our apps diff --git a/2.4/jessie/slim/Dockerfile b/2.4/jessie/slim/Dockerfile index fcde48884..897c18cb9 100644 --- a/2.4/jessie/slim/Dockerfile +++ b/2.4/jessie/slim/Dockerfile @@ -22,8 +22,7 @@ RUN mkdir -p /usr/local/etc \ ENV RUBY_MAJOR 2.4 ENV RUBY_VERSION 2.4.5 ENV RUBY_DOWNLOAD_SHA256 2f0cdcce9989f63ef7c2939bdb17b1ef244c4f384d85b8531d60e73d8cc31eeb -ENV RUBYGEMS_VERSION 3.0.2 -ENV BUNDLER_VERSION 2.0.1 +ENV RUBYGEMS_VERSION 3.0.1 # some of ruby's build scripts are written in ruby # we purge system ruby later to make sure our final image uses what we just built @@ -83,10 +82,11 @@ RUN set -ex \ && apt-get purge -y --auto-remove $buildDeps \ && cd / \ && rm -r /usr/src/ruby \ - \ - && gem update --system "$RUBYGEMS_VERSION" \ - && gem install bundler --version "$BUNDLER_VERSION" --force \ - && rm -r /root/.gem/ +# make sure bundled "rubygems" is older than RUBYGEMS_VERSION (https://github.com/docker-library/ruby/issues/246) + && ruby -e 'exit(Gem::Version.create(ENV["RUBYGEMS_VERSION"]) > Gem::Version.create(Gem::VERSION))' \ + && gem update --system "$RUBYGEMS_VERSION" && rm -r /root/.gem/ \ +# rough smoke test + && ruby --version && gem --version && bundle --version # install things globally, for great justice # and don't create ".bundle" in all our apps diff --git a/2.4/stretch/Dockerfile b/2.4/stretch/Dockerfile index 52a72d58e..4ba0cbb2b 100644 --- a/2.4/stretch/Dockerfile +++ b/2.4/stretch/Dockerfile @@ -10,8 +10,7 @@ RUN mkdir -p /usr/local/etc \ ENV RUBY_MAJOR 2.4 ENV RUBY_VERSION 2.4.5 ENV RUBY_DOWNLOAD_SHA256 2f0cdcce9989f63ef7c2939bdb17b1ef244c4f384d85b8531d60e73d8cc31eeb -ENV RUBYGEMS_VERSION 3.0.2 -ENV BUNDLER_VERSION 2.0.1 +ENV RUBYGEMS_VERSION 3.0.1 # some of ruby's build scripts are written in ruby # we purge system ruby later to make sure our final image uses what we just built @@ -57,10 +56,11 @@ RUN set -ex \ && apt-get purge -y --auto-remove $buildDeps \ && cd / \ && rm -r /usr/src/ruby \ - \ - && gem update --system "$RUBYGEMS_VERSION" \ - && gem install bundler --version "$BUNDLER_VERSION" --force \ - && rm -r /root/.gem/ +# make sure bundled "rubygems" is older than RUBYGEMS_VERSION (https://github.com/docker-library/ruby/issues/246) + && ruby -e 'exit(Gem::Version.create(ENV["RUBYGEMS_VERSION"]) > Gem::Version.create(Gem::VERSION))' \ + && gem update --system "$RUBYGEMS_VERSION" && rm -r /root/.gem/ \ +# rough smoke test + && ruby --version && gem --version && bundle --version # install things globally, for great justice # and don't create ".bundle" in all our apps diff --git a/2.4/stretch/slim/Dockerfile b/2.4/stretch/slim/Dockerfile index fabd984c3..263907995 100644 --- a/2.4/stretch/slim/Dockerfile +++ b/2.4/stretch/slim/Dockerfile @@ -22,8 +22,7 @@ RUN mkdir -p /usr/local/etc \ ENV RUBY_MAJOR 2.4 ENV RUBY_VERSION 2.4.5 ENV RUBY_DOWNLOAD_SHA256 2f0cdcce9989f63ef7c2939bdb17b1ef244c4f384d85b8531d60e73d8cc31eeb -ENV RUBYGEMS_VERSION 3.0.2 -ENV BUNDLER_VERSION 2.0.1 +ENV RUBYGEMS_VERSION 3.0.1 # some of ruby's build scripts are written in ruby # we purge system ruby later to make sure our final image uses what we just built @@ -83,10 +82,11 @@ RUN set -ex \ && apt-get purge -y --auto-remove $buildDeps \ && cd / \ && rm -r /usr/src/ruby \ - \ - && gem update --system "$RUBYGEMS_VERSION" \ - && gem install bundler --version "$BUNDLER_VERSION" --force \ - && rm -r /root/.gem/ +# make sure bundled "rubygems" is older than RUBYGEMS_VERSION (https://github.com/docker-library/ruby/issues/246) + && ruby -e 'exit(Gem::Version.create(ENV["RUBYGEMS_VERSION"]) > Gem::Version.create(Gem::VERSION))' \ + && gem update --system "$RUBYGEMS_VERSION" && rm -r /root/.gem/ \ +# rough smoke test + && ruby --version && gem --version && bundle --version # install things globally, for great justice # and don't create ".bundle" in all our apps diff --git a/2.5/alpine3.7/Dockerfile b/2.5/alpine3.7/Dockerfile index 64cbadc89..9a8771d91 100644 --- a/2.5/alpine3.7/Dockerfile +++ b/2.5/alpine3.7/Dockerfile @@ -10,8 +10,7 @@ RUN mkdir -p /usr/local/etc \ ENV RUBY_MAJOR 2.5 ENV RUBY_VERSION 2.5.3 ENV RUBY_DOWNLOAD_SHA256 1cc9d0359a8ea35fc6111ec830d12e60168f3b9b305a3c2578357d360fcf306f -ENV RUBYGEMS_VERSION 3.0.2 -ENV BUNDLER_VERSION 2.0.1 +ENV RUBYGEMS_VERSION 3.0.1 # some of ruby's build scripts are written in ruby # we purge system ruby later to make sure our final image uses what we just built @@ -99,10 +98,11 @@ RUN set -ex \ && apk del --no-network .ruby-builddeps \ && cd / \ && rm -r /usr/src/ruby \ - \ - && gem update --system "$RUBYGEMS_VERSION" \ - && gem install bundler --version "$BUNDLER_VERSION" --force \ - && rm -r /root/.gem/ +# make sure bundled "rubygems" is older than RUBYGEMS_VERSION (https://github.com/docker-library/ruby/issues/246) + && ruby -e 'exit(Gem::Version.create(ENV["RUBYGEMS_VERSION"]) > Gem::Version.create(Gem::VERSION))' \ + && gem update --system "$RUBYGEMS_VERSION" && rm -r /root/.gem/ \ +# rough smoke test + && ruby --version && gem --version && bundle --version # install things globally, for great justice # and don't create ".bundle" in all our apps diff --git a/2.5/alpine3.8/Dockerfile b/2.5/alpine3.8/Dockerfile index e95d1e280..0ce40e558 100644 --- a/2.5/alpine3.8/Dockerfile +++ b/2.5/alpine3.8/Dockerfile @@ -10,8 +10,7 @@ RUN mkdir -p /usr/local/etc \ ENV RUBY_MAJOR 2.5 ENV RUBY_VERSION 2.5.3 ENV RUBY_DOWNLOAD_SHA256 1cc9d0359a8ea35fc6111ec830d12e60168f3b9b305a3c2578357d360fcf306f -ENV RUBYGEMS_VERSION 3.0.2 -ENV BUNDLER_VERSION 2.0.1 +ENV RUBYGEMS_VERSION 3.0.1 # some of ruby's build scripts are written in ruby # we purge system ruby later to make sure our final image uses what we just built @@ -99,10 +98,11 @@ RUN set -ex \ && apk del --no-network .ruby-builddeps \ && cd / \ && rm -r /usr/src/ruby \ - \ - && gem update --system "$RUBYGEMS_VERSION" \ - && gem install bundler --version "$BUNDLER_VERSION" --force \ - && rm -r /root/.gem/ +# make sure bundled "rubygems" is older than RUBYGEMS_VERSION (https://github.com/docker-library/ruby/issues/246) + && ruby -e 'exit(Gem::Version.create(ENV["RUBYGEMS_VERSION"]) > Gem::Version.create(Gem::VERSION))' \ + && gem update --system "$RUBYGEMS_VERSION" && rm -r /root/.gem/ \ +# rough smoke test + && ruby --version && gem --version && bundle --version # install things globally, for great justice # and don't create ".bundle" in all our apps diff --git a/2.5/stretch/Dockerfile b/2.5/stretch/Dockerfile index 027a1d6f1..8d9ab2692 100644 --- a/2.5/stretch/Dockerfile +++ b/2.5/stretch/Dockerfile @@ -10,8 +10,7 @@ RUN mkdir -p /usr/local/etc \ ENV RUBY_MAJOR 2.5 ENV RUBY_VERSION 2.5.3 ENV RUBY_DOWNLOAD_SHA256 1cc9d0359a8ea35fc6111ec830d12e60168f3b9b305a3c2578357d360fcf306f -ENV RUBYGEMS_VERSION 3.0.2 -ENV BUNDLER_VERSION 2.0.1 +ENV RUBYGEMS_VERSION 3.0.1 # some of ruby's build scripts are written in ruby # we purge system ruby later to make sure our final image uses what we just built @@ -57,10 +56,11 @@ RUN set -ex \ && apt-get purge -y --auto-remove $buildDeps \ && cd / \ && rm -r /usr/src/ruby \ - \ - && gem update --system "$RUBYGEMS_VERSION" \ - && gem install bundler --version "$BUNDLER_VERSION" --force \ - && rm -r /root/.gem/ +# make sure bundled "rubygems" is older than RUBYGEMS_VERSION (https://github.com/docker-library/ruby/issues/246) + && ruby -e 'exit(Gem::Version.create(ENV["RUBYGEMS_VERSION"]) > Gem::Version.create(Gem::VERSION))' \ + && gem update --system "$RUBYGEMS_VERSION" && rm -r /root/.gem/ \ +# rough smoke test + && ruby --version && gem --version && bundle --version # install things globally, for great justice # and don't create ".bundle" in all our apps diff --git a/2.5/stretch/slim/Dockerfile b/2.5/stretch/slim/Dockerfile index d1af5b1d5..e80f1b538 100644 --- a/2.5/stretch/slim/Dockerfile +++ b/2.5/stretch/slim/Dockerfile @@ -22,8 +22,7 @@ RUN mkdir -p /usr/local/etc \ ENV RUBY_MAJOR 2.5 ENV RUBY_VERSION 2.5.3 ENV RUBY_DOWNLOAD_SHA256 1cc9d0359a8ea35fc6111ec830d12e60168f3b9b305a3c2578357d360fcf306f -ENV RUBYGEMS_VERSION 3.0.2 -ENV BUNDLER_VERSION 2.0.1 +ENV RUBYGEMS_VERSION 3.0.1 # some of ruby's build scripts are written in ruby # we purge system ruby later to make sure our final image uses what we just built @@ -83,10 +82,11 @@ RUN set -ex \ && apt-get purge -y --auto-remove $buildDeps \ && cd / \ && rm -r /usr/src/ruby \ - \ - && gem update --system "$RUBYGEMS_VERSION" \ - && gem install bundler --version "$BUNDLER_VERSION" --force \ - && rm -r /root/.gem/ +# make sure bundled "rubygems" is older than RUBYGEMS_VERSION (https://github.com/docker-library/ruby/issues/246) + && ruby -e 'exit(Gem::Version.create(ENV["RUBYGEMS_VERSION"]) > Gem::Version.create(Gem::VERSION))' \ + && gem update --system "$RUBYGEMS_VERSION" && rm -r /root/.gem/ \ +# rough smoke test + && ruby --version && gem --version && bundle --version # install things globally, for great justice # and don't create ".bundle" in all our apps diff --git a/2.6/alpine3.7/Dockerfile b/2.6/alpine3.7/Dockerfile index 2cc9e5a18..ea803bca1 100644 --- a/2.6/alpine3.7/Dockerfile +++ b/2.6/alpine3.7/Dockerfile @@ -10,8 +10,6 @@ RUN mkdir -p /usr/local/etc \ ENV RUBY_MAJOR 2.6 ENV RUBY_VERSION 2.6.0 ENV RUBY_DOWNLOAD_SHA256 acb00f04374899ba8ee74bbbcb9b35c5c6b1fd229f1876554ee76f0f1710ff5f -ENV RUBYGEMS_VERSION 3.0.2 -ENV BUNDLER_VERSION 2.0.1 # some of ruby's build scripts are written in ruby # we purge system ruby later to make sure our final image uses what we just built @@ -99,10 +97,8 @@ RUN set -ex \ && apk del --no-network .ruby-builddeps \ && cd / \ && rm -r /usr/src/ruby \ - \ - && gem update --system "$RUBYGEMS_VERSION" \ - && gem install bundler --version "$BUNDLER_VERSION" --force \ - && rm -r /root/.gem/ +# rough smoke test + && ruby --version && gem --version && bundle --version # install things globally, for great justice # and don't create ".bundle" in all our apps diff --git a/2.6/alpine3.8/Dockerfile b/2.6/alpine3.8/Dockerfile index 40a702cca..e5290bb23 100644 --- a/2.6/alpine3.8/Dockerfile +++ b/2.6/alpine3.8/Dockerfile @@ -10,8 +10,6 @@ RUN mkdir -p /usr/local/etc \ ENV RUBY_MAJOR 2.6 ENV RUBY_VERSION 2.6.0 ENV RUBY_DOWNLOAD_SHA256 acb00f04374899ba8ee74bbbcb9b35c5c6b1fd229f1876554ee76f0f1710ff5f -ENV RUBYGEMS_VERSION 3.0.2 -ENV BUNDLER_VERSION 2.0.1 # some of ruby's build scripts are written in ruby # we purge system ruby later to make sure our final image uses what we just built @@ -99,10 +97,8 @@ RUN set -ex \ && apk del --no-network .ruby-builddeps \ && cd / \ && rm -r /usr/src/ruby \ - \ - && gem update --system "$RUBYGEMS_VERSION" \ - && gem install bundler --version "$BUNDLER_VERSION" --force \ - && rm -r /root/.gem/ +# rough smoke test + && ruby --version && gem --version && bundle --version # install things globally, for great justice # and don't create ".bundle" in all our apps diff --git a/2.6/stretch/Dockerfile b/2.6/stretch/Dockerfile index 7feb36696..dfd2a92cb 100644 --- a/2.6/stretch/Dockerfile +++ b/2.6/stretch/Dockerfile @@ -10,8 +10,6 @@ RUN mkdir -p /usr/local/etc \ ENV RUBY_MAJOR 2.6 ENV RUBY_VERSION 2.6.0 ENV RUBY_DOWNLOAD_SHA256 acb00f04374899ba8ee74bbbcb9b35c5c6b1fd229f1876554ee76f0f1710ff5f -ENV RUBYGEMS_VERSION 3.0.2 -ENV BUNDLER_VERSION 2.0.1 # some of ruby's build scripts are written in ruby # we purge system ruby later to make sure our final image uses what we just built @@ -57,10 +55,8 @@ RUN set -ex \ && apt-get purge -y --auto-remove $buildDeps \ && cd / \ && rm -r /usr/src/ruby \ - \ - && gem update --system "$RUBYGEMS_VERSION" \ - && gem install bundler --version "$BUNDLER_VERSION" --force \ - && rm -r /root/.gem/ +# rough smoke test + && ruby --version && gem --version && bundle --version # install things globally, for great justice # and don't create ".bundle" in all our apps diff --git a/2.6/stretch/slim/Dockerfile b/2.6/stretch/slim/Dockerfile index 72b53f407..0176c5143 100644 --- a/2.6/stretch/slim/Dockerfile +++ b/2.6/stretch/slim/Dockerfile @@ -22,8 +22,6 @@ RUN mkdir -p /usr/local/etc \ ENV RUBY_MAJOR 2.6 ENV RUBY_VERSION 2.6.0 ENV RUBY_DOWNLOAD_SHA256 acb00f04374899ba8ee74bbbcb9b35c5c6b1fd229f1876554ee76f0f1710ff5f -ENV RUBYGEMS_VERSION 3.0.2 -ENV BUNDLER_VERSION 2.0.1 # some of ruby's build scripts are written in ruby # we purge system ruby later to make sure our final image uses what we just built @@ -83,10 +81,8 @@ RUN set -ex \ && apt-get purge -y --auto-remove $buildDeps \ && cd / \ && rm -r /usr/src/ruby \ - \ - && gem update --system "$RUBYGEMS_VERSION" \ - && gem install bundler --version "$BUNDLER_VERSION" --force \ - && rm -r /root/.gem/ +# rough smoke test + && ruby --version && gem --version && bundle --version # install things globally, for great justice # and don't create ".bundle" in all our apps diff --git a/Dockerfile-alpine.template b/Dockerfile-alpine.template index 44d86c18d..2f891e6d9 100644 --- a/Dockerfile-alpine.template +++ b/Dockerfile-alpine.template @@ -11,7 +11,6 @@ ENV RUBY_MAJOR %%VERSION%% ENV RUBY_VERSION %%FULL_VERSION%% ENV RUBY_DOWNLOAD_SHA256 %%SHA256%% ENV RUBYGEMS_VERSION %%RUBYGEMS%% -ENV BUNDLER_VERSION %%BUNDLER%% # some of ruby's build scripts are written in ruby # we purge system ruby later to make sure our final image uses what we just built @@ -99,10 +98,11 @@ RUN set -ex \ && apk del --no-network .ruby-builddeps \ && cd / \ && rm -r /usr/src/ruby \ - \ - && gem update --system "$RUBYGEMS_VERSION" \ - && gem install bundler --version "$BUNDLER_VERSION" --force \ - && rm -r /root/.gem/ +# make sure bundled "rubygems" is older than RUBYGEMS_VERSION (https://github.com/docker-library/ruby/issues/246) + && ruby -e 'exit(Gem::Version.create(ENV["RUBYGEMS_VERSION"]) > Gem::Version.create(Gem::VERSION))' \ + && gem update --system "$RUBYGEMS_VERSION" && rm -r /root/.gem/ \ +# rough smoke test + && ruby --version && gem --version && bundle --version # install things globally, for great justice # and don't create ".bundle" in all our apps diff --git a/Dockerfile-debian.template b/Dockerfile-debian.template index 3eb568b96..8cae1f194 100644 --- a/Dockerfile-debian.template +++ b/Dockerfile-debian.template @@ -11,7 +11,6 @@ ENV RUBY_MAJOR %%VERSION%% ENV RUBY_VERSION %%FULL_VERSION%% ENV RUBY_DOWNLOAD_SHA256 %%SHA256%% ENV RUBYGEMS_VERSION %%RUBYGEMS%% -ENV BUNDLER_VERSION %%BUNDLER%% # some of ruby's build scripts are written in ruby # we purge system ruby later to make sure our final image uses what we just built @@ -59,10 +58,11 @@ RUN set -ex \ && apt-get purge -y --auto-remove $buildDeps \ && cd / \ && rm -r /usr/src/ruby \ - \ - && gem update --system "$RUBYGEMS_VERSION" \ - && gem install bundler --version "$BUNDLER_VERSION" --force \ - && rm -r /root/.gem/ +# make sure bundled "rubygems" is older than RUBYGEMS_VERSION (https://github.com/docker-library/ruby/issues/246) + && ruby -e 'exit(Gem::Version.create(ENV["RUBYGEMS_VERSION"]) > Gem::Version.create(Gem::VERSION))' \ + && gem update --system "$RUBYGEMS_VERSION" && rm -r /root/.gem/ \ +# rough smoke test + && ruby --version && gem --version && bundle --version # install things globally, for great justice # and don't create ".bundle" in all our apps diff --git a/Dockerfile-slim.template b/Dockerfile-slim.template index 3c2846a41..d0d5e6629 100644 --- a/Dockerfile-slim.template +++ b/Dockerfile-slim.template @@ -23,7 +23,6 @@ ENV RUBY_MAJOR %%VERSION%% ENV RUBY_VERSION %%FULL_VERSION%% ENV RUBY_DOWNLOAD_SHA256 %%SHA256%% ENV RUBYGEMS_VERSION %%RUBYGEMS%% -ENV BUNDLER_VERSION %%BUNDLER%% # some of ruby's build scripts are written in ruby # we purge system ruby later to make sure our final image uses what we just built @@ -83,10 +82,11 @@ RUN set -ex \ && apt-get purge -y --auto-remove $buildDeps \ && cd / \ && rm -r /usr/src/ruby \ - \ - && gem update --system "$RUBYGEMS_VERSION" \ - && gem install bundler --version "$BUNDLER_VERSION" --force \ - && rm -r /root/.gem/ +# make sure bundled "rubygems" is older than RUBYGEMS_VERSION (https://github.com/docker-library/ruby/issues/246) + && ruby -e 'exit(Gem::Version.create(ENV["RUBYGEMS_VERSION"]) > Gem::Version.create(Gem::VERSION))' \ + && gem update --system "$RUBYGEMS_VERSION" && rm -r /root/.gem/ \ +# rough smoke test + && ruby --version && gem --version && bundle --version # install things globally, for great justice # and don't create ".bundle" in all our apps diff --git a/update.sh b/update.sh index 0c1222932..4117eefe8 100755 --- a/update.sh +++ b/update.sh @@ -17,8 +17,12 @@ latest_gem_version() { curl -fsSL "https://rubygems.org/api/v1/gems/$1.json" | sed -r 's/^.*"version":"([^"]+)".*$/\1/' } -rubygems="$(latest_gem_version rubygems-update)" -bundler="$(latest_gem_version bundler)" +# https://github.com/docker-library/ruby/issues/246 +rubygems='3.0.1' +declare -A newEnoughRubygems=( + [2.6]=1 # 3.0.1+ +) +# TODO once all versions are in this family of "new enough", remove RUBYGEMS_VERSION code entirely travisEnv= for version in "${versions[@]}"; do @@ -63,7 +67,7 @@ for version in "${versions[@]}"; do continue fi - echo "$version: $fullVersion; rubygems $rubygems, bundler $bundler; $shaVal" + echo "$version: $fullVersion; $shaVal" for v in \ alpine{3.6,3.7,3.8} \ @@ -86,7 +90,6 @@ for version in "${versions[@]}"; do -e 's!%%FULL_VERSION%%!'"$fullVersion"'!g' \ -e 's!%%SHA256%%!'"$shaVal"'!g' \ -e 's!%%RUBYGEMS%%!'"$rubygems"'!g' \ - -e 's!%%BUNDLER%%!'"$bundler"'!g' \ -e "$( if [ "$version" = 2.3 ] && [[ "$v" = stretch* ]]; then echo 's/libssl-dev/libssl1.0-dev/g' @@ -97,6 +100,10 @@ for version in "${versions[@]}"; do -e 's/^(FROM (debian|buildpack-deps|alpine)):.*/\1:'"$tag"'/' \ "$template" > "$dir/Dockerfile" + if [ -n "${newEnoughRubygems[$version]:-}" ]; then + sed -ri -e '/RUBYGEMS_VERSION/d' "$dir/Dockerfile" + fi + travisEnv='\n - VERSION='"$version VARIANT=$v$travisEnv" done done