Skip to content

Commit

Permalink
Merge pull request docker-library#44 from infosiftr/explicit-bundler
Browse files Browse the repository at this point in the history
Add an explicit BUNDLER_VERSION
  • Loading branch information
yosifkit committed Jun 12, 2015
2 parents de0bb69 + b99f51c commit e553432
Show file tree
Hide file tree
Showing 10 changed files with 71 additions and 15 deletions.
5 changes: 4 additions & 1 deletion 2.0/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
15 changes: 13 additions & 2 deletions 2.0/slim/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
5 changes: 4 additions & 1 deletion 2.0/wheezy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
5 changes: 4 additions & 1 deletion 2.1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
15 changes: 13 additions & 2 deletions 2.1/slim/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
5 changes: 4 additions & 1 deletion 2.1/wheezy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
5 changes: 4 additions & 1 deletion 2.2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
15 changes: 13 additions & 2 deletions 2.2/slim/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
5 changes: 4 additions & 1 deletion 2.2/wheezy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
11 changes: 8 additions & 3 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 '<a href="ruby-'"$version"'.[^"]+\.tar\.bz2' \
Expand All @@ -19,9 +21,12 @@ for version in "${versions[@]}"; do
shaVal="$(echo $shaPage | sed -r "s/.*Ruby ${fullVersion}<\/a><br \/> 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

0 comments on commit e553432

Please sign in to comment.