1
0
Fork 0
mirror of https://github.com/docker-library/ruby.git synced 2022-11-09 11:41:34 -05:00

Fix update script and add sha256 validation

This commit is contained in:
Moghedrin 2015-03-23 14:34:12 -06:00
parent feb04709b1
commit 00aae8a4d6
4 changed files with 18 additions and 6 deletions

View file

@ -2,6 +2,7 @@ FROM buildpack-deps:jessie
ENV RUBY_MAJOR 2.0
ENV RUBY_VERSION 2.0.0-p643
ENV RUBY_DOWNLOAD_SHA256 4bd267a4187e4bc25c1db08f9f9bdc0ce595a705569cac460d98c4f5b02e614e
# some of ruby's build scripts are written in ruby
# we purge this later to make sure our final image uses what we just built
@ -9,8 +10,10 @@ RUN apt-get update \
&& apt-get install -y bison libgdbm-dev ruby \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p /usr/src/ruby \
&& curl -SL "http://cache.ruby-lang.org/pub/ruby/$RUBY_MAJOR/ruby-$RUBY_VERSION.tar.bz2" \
| tar -xjC /usr/src/ruby --strip-components=1 \
&& curl -fSL -o ruby.tar.gz "http://cache.ruby-lang.org/pub/ruby/$RUBY_MAJOR/ruby-$RUBY_VERSION.tar.gz" \
&& echo "$RUBY_DOWNLOAD_SHA256 *ruby.tar.gz" | sha256sum -c - \
&& tar -xzf ruby.tar.gz -C /usr/src/ruby --strip-components=1 \
&& rm ruby.tar.gz \
&& cd /usr/src/ruby \
&& autoconf \
&& ./configure --disable-install-doc \

View file

@ -2,6 +2,7 @@ FROM buildpack-deps:jessie
ENV RUBY_MAJOR 2.1
ENV RUBY_VERSION 2.1.5
ENV RUBY_DOWNLOAD_SHA256 4305cc6ceb094df55210d83548dcbeb5117d74eea25196a9b14fa268d354b100
# some of ruby's build scripts are written in ruby
# we purge this later to make sure our final image uses what we just built
@ -9,8 +10,10 @@ RUN apt-get update \
&& apt-get install -y bison libgdbm-dev ruby \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p /usr/src/ruby \
&& curl -SL "http://cache.ruby-lang.org/pub/ruby/$RUBY_MAJOR/ruby-$RUBY_VERSION.tar.bz2" \
| tar -xjC /usr/src/ruby --strip-components=1 \
&& curl -fSL -o ruby.tar.gz "http://cache.ruby-lang.org/pub/ruby/$RUBY_MAJOR/ruby-$RUBY_VERSION.tar.gz" \
&& echo "$RUBY_DOWNLOAD_SHA256 *ruby.tar.gz" | sha256sum -c - \
&& tar -xzf ruby.tar.gz -C /usr/src/ruby --strip-components=1 \
&& rm ruby.tar.gz \
&& cd /usr/src/ruby \
&& autoconf \
&& ./configure --disable-install-doc \

View file

@ -2,6 +2,7 @@ FROM buildpack-deps:jessie
ENV RUBY_MAJOR 2.2
ENV RUBY_VERSION 2.2.1
ENV RUBY_DOWNLOAD_SHA256 5a4de38068eca8919cb087d338c0c2e3d72c9382c804fb27ab746e6c7819ab28
# some of ruby's build scripts are written in ruby
# we purge this later to make sure our final image uses what we just built
@ -9,8 +10,10 @@ RUN apt-get update \
&& apt-get install -y bison libgdbm-dev ruby \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p /usr/src/ruby \
&& curl -SL "http://cache.ruby-lang.org/pub/ruby/$RUBY_MAJOR/ruby-$RUBY_VERSION.tar.bz2" \
| tar -xjC /usr/src/ruby --strip-components=1 \
&& curl -fSL -o ruby.tar.gz "http://cache.ruby-lang.org/pub/ruby/$RUBY_MAJOR/ruby-$RUBY_VERSION.tar.gz" \
&& echo "$RUBY_DOWNLOAD_SHA256 *ruby.tar.gz" | sha256sum -c - \
&& tar -xzf ruby.tar.gz -C /usr/src/ruby --strip-components=1 \
&& rm ruby.tar.gz \
&& cd /usr/src/ruby \
&& autoconf \
&& ./configure --disable-install-doc \

View file

@ -8,6 +8,7 @@ if [ ${#versions[@]} -eq 0 ]; then
versions=( */ )
fi
versions=( "${versions[@]%/}" )
shaPage=$(curl -fsSL 'https://www.ruby-lang.org/en/downloads/')
for version in "${versions[@]}"; do
fullVersion="$(curl -sSL --compressed "http://cache.ruby-lang.org/pub/ruby/$version/" \
@ -15,10 +16,12 @@ for version in "${versions[@]}"; do
| grep -vE 'preview|rc' \
| sed -r 's!.*<a href="ruby-([^"]+)\.tar\.bz2.*!\1!' \
| sort -V | tail -1)"
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/^(FROM ruby):.*/\1:'"$fullVersion"'/' "$version/"*"/Dockerfile"
)
done