Skip to content

Commit 088e195

Browse files
committed
Simplify SHA1 handling (let sha1sum do all the work)
Also, dropped `-s` on `curl` and added `-o` so we can get progress indication (those tarballs download _really_ slow in my testing), and fixed the `gemrc` appending to work with newer versions of Docker that actually set `HOME` appropriately. 👍
1 parent 1ad1afd commit 088e195

4 files changed

Lines changed: 20 additions & 36 deletions

File tree

1.7/jdk/Dockerfile

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,14 @@ FROM java:8-jdk
22
ENV JRUBY_VERSION 1.7.19
33
ENV JRUBY_SHA1 a3296d1ae9b9aa78825b8d65a0d2498b449eaa3d
44
RUN mkdir /opt/jruby \
5-
&& curl -sSL https://s3.amazonaws.com/jruby.org/downloads/${JRUBY_VERSION}/jruby-bin-${JRUBY_VERSION}.tar.gz > /tmp/jruby.tar.gz \
6-
&& export JRUBY_SHA1_CALC=$(sha1sum /tmp/jruby.tar.gz | awk '{ print $1 }') \
7-
&& [ "$JRUBY_SHA1" != "$JRUBY_SHA1_CALC" ] && { \
8-
echo "sha sum did not match expected: \"$JRUBY_SHA1\" - got: \"$JRUBY_SHA1_CALC\"" \
9-
&& exit 1;}; \
10-
tar -zx --strip-components=1 -f /tmp/jruby.tar.gz -C /opt/jruby \
5+
&& curl -SL https://s3.amazonaws.com/jruby.org/downloads/${JRUBY_VERSION}/jruby-bin-${JRUBY_VERSION}.tar.gz -o /tmp/jruby.tar.gz \
6+
&& echo "$JRUBY_SHA1 /tmp/jruby.tar.gz" | sha1sum -c - \
7+
&& tar -zx --strip-components=1 -f /tmp/jruby.tar.gz -C /opt/jruby \
118
&& rm /tmp/jruby.tar.gz \
12-
&& update-alternatives --install /usr/local/bin/ruby ruby /opt/jruby/bin/jruby 1 \
13-
&& exit 0; }
9+
&& update-alternatives --install /usr/local/bin/ruby ruby /opt/jruby/bin/jruby 1
1410
ENV PATH /opt/jruby/bin:$PATH
1511

16-
RUN echo 'gem: --no-rdoc --no-ri' >> /.gemrc
12+
RUN echo 'gem: --no-rdoc --no-ri' >> ~/.gemrc
1713

1814
ENV GEM_HOME /usr/local/bundle
1915
ENV PATH $GEM_HOME/bin:$PATH

1.7/jre/Dockerfile

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,14 @@ FROM java:8-jre
22
ENV JRUBY_VERSION 1.7.19
33
ENV JRUBY_SHA1 a3296d1ae9b9aa78825b8d65a0d2498b449eaa3d
44
RUN mkdir /opt/jruby \
5-
&& curl -sSL https://s3.amazonaws.com/jruby.org/downloads/${JRUBY_VERSION}/jruby-bin-${JRUBY_VERSION}.tar.gz > /tmp/jruby.tar.gz \
6-
&& export JRUBY_SHA1_CALC=$(sha1sum /tmp/jruby.tar.gz | awk '{ print $1 }') \
7-
&& [ "$JRUBY_SHA1" != "$JRUBY_SHA1_CALC" ] && { \
8-
echo "sha sum did not match expected: \"$JRUBY_SHA1\" - got: \"$JRUBY_SHA1_CALC\"" \
9-
&& exit 1;}; \
10-
tar -zx --strip-components=1 -f /tmp/jruby.tar.gz -C /opt/jruby \
5+
&& curl -SL https://s3.amazonaws.com/jruby.org/downloads/${JRUBY_VERSION}/jruby-bin-${JRUBY_VERSION}.tar.gz -o /tmp/jruby.tar.gz \
6+
&& echo "$JRUBY_SHA1 /tmp/jruby.tar.gz" | sha1sum -c - \
7+
&& tar -zx --strip-components=1 -f /tmp/jruby.tar.gz -C /opt/jruby \
118
&& rm /tmp/jruby.tar.gz \
12-
&& update-alternatives --install /usr/local/bin/ruby ruby /opt/jruby/bin/jruby 1 \
13-
&& exit 0; }
9+
&& update-alternatives --install /usr/local/bin/ruby ruby /opt/jruby/bin/jruby 1
1410
ENV PATH /opt/jruby/bin:$PATH
1511

16-
RUN echo 'gem: --no-rdoc --no-ri' >> /.gemrc
12+
RUN echo 'gem: --no-rdoc --no-ri' >> ~/.gemrc
1713

1814
ENV GEM_HOME /usr/local/bundle
1915
ENV PATH $GEM_HOME/bin:$PATH

9000/jdk/Dockerfile

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,14 @@ FROM java:8-jdk
22
ENV JRUBY_VERSION 9.0.0.0.pre1
33
ENV JRUBY_SHA1 fc2e037643f233332687bdd9d6d3405ed981c21c
44
RUN mkdir /opt/jruby \
5-
&& curl -sSL https://s3.amazonaws.com/jruby.org/downloads/${JRUBY_VERSION}/jruby-bin-${JRUBY_VERSION}.tar.gz > /tmp/jruby.tar.gz \
6-
&& export JRUBY_SHA1_CALC=$(sha1sum /tmp/jruby.tar.gz | awk '{ print $1 }') \
7-
&& [ "$JRUBY_SHA1" != "$JRUBY_SHA1_CALC" ] && { \
8-
echo "sha sum did not match expected: \"$JRUBY_SHA1\" - got: \"$JRUBY_SHA1_CALC\"" \
9-
&& exit 1;}; \
10-
tar -zx --strip-components=1 -f /tmp/jruby.tar.gz -C /opt/jruby \
5+
&& curl -SL https://s3.amazonaws.com/jruby.org/downloads/${JRUBY_VERSION}/jruby-bin-${JRUBY_VERSION}.tar.gz -o /tmp/jruby.tar.gz \
6+
&& echo "$JRUBY_SHA1 /tmp/jruby.tar.gz" | sha1sum -c - \
7+
&& tar -zx --strip-components=1 -f /tmp/jruby.tar.gz -C /opt/jruby \
118
&& rm /tmp/jruby.tar.gz \
12-
&& update-alternatives --install /usr/local/bin/ruby ruby /opt/jruby/bin/jruby 1 \
13-
&& exit 0; }
9+
&& update-alternatives --install /usr/local/bin/ruby ruby /opt/jruby/bin/jruby 1
1410
ENV PATH /opt/jruby/bin:$PATH
1511

16-
RUN echo 'gem: --no-rdoc --no-ri' >> /.gemrc
12+
RUN echo 'gem: --no-rdoc --no-ri' >> ~/.gemrc
1713

1814
ENV GEM_HOME /usr/local/bundle
1915
ENV PATH $GEM_HOME/bin:$PATH

9000/jre/Dockerfile

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,14 @@ FROM java:8-jre
22
ENV JRUBY_VERSION 9.0.0.0.pre1
33
ENV JRUBY_SHA1 fc2e037643f233332687bdd9d6d3405ed981c21c
44
RUN mkdir /opt/jruby \
5-
&& curl -sSL https://s3.amazonaws.com/jruby.org/downloads/${JRUBY_VERSION}/jruby-bin-${JRUBY_VERSION}.tar.gz > /tmp/jruby.tar.gz \
6-
&& export JRUBY_SHA1_CALC=$(sha1sum /tmp/jruby.tar.gz | awk '{ print $1 }') \
7-
&& [ "$JRUBY_SHA1" != "$JRUBY_SHA1_CALC" ] && { \
8-
echo "sha sum did not match expected: \"$JRUBY_SHA1\" - got: \"$JRUBY_SHA1_CALC\"" \
9-
&& exit 1;}; \
10-
tar -zx --strip-components=1 -f /tmp/jruby.tar.gz -C /opt/jruby \
5+
&& curl -SL https://s3.amazonaws.com/jruby.org/downloads/${JRUBY_VERSION}/jruby-bin-${JRUBY_VERSION}.tar.gz -o /tmp/jruby.tar.gz \
6+
&& echo "$JRUBY_SHA1 /tmp/jruby.tar.gz" | sha1sum -c - \
7+
&& tar -zx --strip-components=1 -f /tmp/jruby.tar.gz -C /opt/jruby \
118
&& rm /tmp/jruby.tar.gz \
12-
&& update-alternatives --install /usr/local/bin/ruby ruby /opt/jruby/bin/jruby 1 \
13-
&& exit 0; }
9+
&& update-alternatives --install /usr/local/bin/ruby ruby /opt/jruby/bin/jruby 1
1410
ENV PATH /opt/jruby/bin:$PATH
1511

16-
RUN echo 'gem: --no-rdoc --no-ri' >> /.gemrc
12+
RUN echo 'gem: --no-rdoc --no-ri' >> ~/.gemrc
1713

1814
ENV GEM_HOME /usr/local/bundle
1915
ENV PATH $GEM_HOME/bin:$PATH

0 commit comments

Comments
 (0)