From b99f51cf01429457ab1841d5b1252464c24ba243 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Fri, 12 Jun 2015 11:06:36 -0700 Subject: [PATCH] Add an explicit BUNDLER_VERSION --- 2.0/Dockerfile | 5 ++++- 2.0/slim/Dockerfile | 15 +++++++++++++-- 2.0/wheezy/Dockerfile | 5 ++++- 2.1/Dockerfile | 5 ++++- 2.1/slim/Dockerfile | 15 +++++++++++++-- 2.1/wheezy/Dockerfile | 5 ++++- 2.2/Dockerfile | 5 ++++- 2.2/slim/Dockerfile | 15 +++++++++++++-- 2.2/wheezy/Dockerfile | 5 ++++- update.sh | 11 ++++++++--- 10 files changed, 71 insertions(+), 15 deletions(-) diff --git a/2.0/Dockerfile b/2.0/Dockerfile index 34167b477..b6dd29000 100644 --- a/2.0/Dockerfile +++ b/2.0/Dockerfile @@ -28,7 +28,10 @@ RUN echo 'gem: --no-rdoc --no-ri' >> "$HOME/.gemrc" # install things globally, for great justice ENV GEM_HOME /usr/local/bundle ENV PATH $GEM_HOME/bin:$PATH -RUN gem install bundler \ + +ENV BUNDLER_VERSION 1.10.3 + +RUN gem install bundler --version "$BUNDLER_VERSION" \ && bundle config --global path "$GEM_HOME" \ && bundle config --global bin "$GEM_HOME/bin" diff --git a/2.0/slim/Dockerfile b/2.0/slim/Dockerfile index e7dcc12ae..b1cde70bf 100644 --- a/2.0/slim/Dockerfile +++ b/2.0/slim/Dockerfile @@ -48,8 +48,19 @@ RUN buildDeps=' \ && apt-get purge -y --auto-remove $buildDeps # skip installing gem documentation -RUN echo 'gem: --no-rdoc --no-ri' >> /.gemrc +RUN echo 'gem: --no-rdoc --no-ri' >> "$HOME/.gemrc" -RUN gem install bundler +# install things globally, for great justice +ENV GEM_HOME /usr/local/bundle +ENV PATH $GEM_HOME/bin:$PATH + +ENV BUNDLER_VERSION 1.10.3 + +RUN gem install bundler --version "$BUNDLER_VERSION" \ + && bundle config --global path "$GEM_HOME" \ + && bundle config --global bin "$GEM_HOME/bin" + +# don't create ".bundle" in all our apps +ENV BUNDLE_APP_CONFIG $GEM_HOME CMD [ "irb" ] diff --git a/2.0/wheezy/Dockerfile b/2.0/wheezy/Dockerfile index bea6709e0..9903fb58e 100644 --- a/2.0/wheezy/Dockerfile +++ b/2.0/wheezy/Dockerfile @@ -25,7 +25,10 @@ RUN echo 'gem: --no-rdoc --no-ri' >> "$HOME/.gemrc" # install things globally, for great justice ENV GEM_HOME /usr/local/bundle ENV PATH $GEM_HOME/bin:$PATH -RUN gem install bundler \ + +ENV BUNDLER_VERSION 1.10.3 + +RUN gem install bundler --version "$BUNDLER_VERSION" \ && bundle config --global path "$GEM_HOME" \ && bundle config --global bin "$GEM_HOME/bin" diff --git a/2.1/Dockerfile b/2.1/Dockerfile index 4b5ff4f6b..72b3ad887 100644 --- a/2.1/Dockerfile +++ b/2.1/Dockerfile @@ -28,7 +28,10 @@ RUN echo 'gem: --no-rdoc --no-ri' >> "$HOME/.gemrc" # install things globally, for great justice ENV GEM_HOME /usr/local/bundle ENV PATH $GEM_HOME/bin:$PATH -RUN gem install bundler \ + +ENV BUNDLER_VERSION 1.10.3 + +RUN gem install bundler --version "$BUNDLER_VERSION" \ && bundle config --global path "$GEM_HOME" \ && bundle config --global bin "$GEM_HOME/bin" diff --git a/2.1/slim/Dockerfile b/2.1/slim/Dockerfile index ae5d75a45..0abb8eac6 100644 --- a/2.1/slim/Dockerfile +++ b/2.1/slim/Dockerfile @@ -48,8 +48,19 @@ RUN buildDeps=' \ && apt-get purge -y --auto-remove $buildDeps # skip installing gem documentation -RUN echo 'gem: --no-rdoc --no-ri' >> /.gemrc +RUN echo 'gem: --no-rdoc --no-ri' >> "$HOME/.gemrc" -RUN gem install bundler +# install things globally, for great justice +ENV GEM_HOME /usr/local/bundle +ENV PATH $GEM_HOME/bin:$PATH + +ENV BUNDLER_VERSION 1.10.3 + +RUN gem install bundler --version "$BUNDLER_VERSION" \ + && bundle config --global path "$GEM_HOME" \ + && bundle config --global bin "$GEM_HOME/bin" + +# don't create ".bundle" in all our apps +ENV BUNDLE_APP_CONFIG $GEM_HOME CMD [ "irb" ] diff --git a/2.1/wheezy/Dockerfile b/2.1/wheezy/Dockerfile index feeef3bbe..3ffec47d4 100644 --- a/2.1/wheezy/Dockerfile +++ b/2.1/wheezy/Dockerfile @@ -25,7 +25,10 @@ RUN echo 'gem: --no-rdoc --no-ri' >> "$HOME/.gemrc" # install things globally, for great justice ENV GEM_HOME /usr/local/bundle ENV PATH $GEM_HOME/bin:$PATH -RUN gem install bundler \ + +ENV BUNDLER_VERSION 1.10.3 + +RUN gem install bundler --version "$BUNDLER_VERSION" \ && bundle config --global path "$GEM_HOME" \ && bundle config --global bin "$GEM_HOME/bin" diff --git a/2.2/Dockerfile b/2.2/Dockerfile index 319296c6c..5ea206a95 100644 --- a/2.2/Dockerfile +++ b/2.2/Dockerfile @@ -28,7 +28,10 @@ RUN echo 'gem: --no-rdoc --no-ri' >> "$HOME/.gemrc" # install things globally, for great justice ENV GEM_HOME /usr/local/bundle ENV PATH $GEM_HOME/bin:$PATH -RUN gem install bundler \ + +ENV BUNDLER_VERSION 1.10.3 + +RUN gem install bundler --version "$BUNDLER_VERSION" \ && bundle config --global path "$GEM_HOME" \ && bundle config --global bin "$GEM_HOME/bin" diff --git a/2.2/slim/Dockerfile b/2.2/slim/Dockerfile index e6e74fc72..865431b9e 100644 --- a/2.2/slim/Dockerfile +++ b/2.2/slim/Dockerfile @@ -48,8 +48,19 @@ RUN buildDeps=' \ && apt-get purge -y --auto-remove $buildDeps # skip installing gem documentation -RUN echo 'gem: --no-rdoc --no-ri' >> /.gemrc +RUN echo 'gem: --no-rdoc --no-ri' >> "$HOME/.gemrc" -RUN gem install bundler +# install things globally, for great justice +ENV GEM_HOME /usr/local/bundle +ENV PATH $GEM_HOME/bin:$PATH + +ENV BUNDLER_VERSION 1.10.3 + +RUN gem install bundler --version "$BUNDLER_VERSION" \ + && bundle config --global path "$GEM_HOME" \ + && bundle config --global bin "$GEM_HOME/bin" + +# don't create ".bundle" in all our apps +ENV BUNDLE_APP_CONFIG $GEM_HOME CMD [ "irb" ] diff --git a/2.2/wheezy/Dockerfile b/2.2/wheezy/Dockerfile index ab5a3bf1e..b50847080 100644 --- a/2.2/wheezy/Dockerfile +++ b/2.2/wheezy/Dockerfile @@ -25,7 +25,10 @@ RUN echo 'gem: --no-rdoc --no-ri' >> "$HOME/.gemrc" # install things globally, for great justice ENV GEM_HOME /usr/local/bundle ENV PATH $GEM_HOME/bin:$PATH -RUN gem install bundler \ + +ENV BUNDLER_VERSION 1.10.3 + +RUN gem install bundler --version "$BUNDLER_VERSION" \ && bundle config --global path "$GEM_HOME" \ && bundle config --global bin "$GEM_HOME/bin" diff --git a/update.sh b/update.sh index b129b16b2..498b66d9b 100755 --- a/update.sh +++ b/update.sh @@ -10,6 +10,8 @@ fi versions=( "${versions[@]%/}" ) shaPage=$(curl -fsSL 'https://www.ruby-lang.org/en/downloads/') +bundler="$(curl -sSL 'https://rubygems.org/api/v1/gems/bundler.json' | sed -r 's/^.*"version":"([^"]+)".*$/\1/')" + for version in "${versions[@]}"; do fullVersion="$(curl -sSL --compressed "http://cache.ruby-lang.org/pub/ruby/$version/" \ | grep -E '
sha256: ([^<]+).*/\1/")" ( set -x - sed -ri 's/^(ENV RUBY_MAJOR) .*/\1 '"$version"'/' "$version/"{,wheezy/,slim/}Dockerfile - sed -ri 's/^(ENV RUBY_VERSION) .*/\1 '"$fullVersion"'/' "$version/"{,wheezy/,slim/}Dockerfile - sed -ri 's/^(ENV RUBY_DOWNLOAD_SHA256) .*/\1 '"$shaVal"'/' "$version/"{,wheezy/,slim/}Dockerfile + sed -ri ' + s/^(ENV RUBY_MAJOR) .*/\1 '"$version"'/; + s/^(ENV RUBY_VERSION) .*/\1 '"$fullVersion"'/; + s/^(ENV RUBY_DOWNLOAD_SHA256) .*/\1 '"$shaVal"'/; + s/^(ENV BUNDLER_VERSION) .*/\1 '"$bundler"'/; + ' "$version/"{,wheezy/,slim/}Dockerfile sed -ri 's/^(FROM ruby):.*/\1:'"$fullVersion"'/' "$version/"*"/Dockerfile" ) done