|
| 1 | +FROM java:8-jdk-alpine |
| 2 | + |
| 3 | +RUN apk add --no-cache \ |
| 4 | + bash \ |
| 5 | + libc6-compat \ |
| 6 | + tar \ |
| 7 | + curl |
| 8 | + |
| 9 | +ENV JRUBY_VERSION 9.1.2.0 |
| 10 | +ENV JRUBY_SHA256 60598a465883ab4c933f805de4a7f280052bddc793b95735465619c03ca43f35 |
| 11 | + |
| 12 | +RUN mkdir -p /opt/jruby && \ |
| 13 | + curl -fSL https://s3.amazonaws.com/jruby.org/downloads/${JRUBY_VERSION}/jruby-bin-${JRUBY_VERSION}.tar.gz -o /tmp/jruby.tar.gz && \ |
| 14 | + echo "$JRUBY_SHA256 */tmp/jruby.tar.gz" | sha256sum -c - && \ |
| 15 | + tar -zx --strip-components=1 -f /tmp/jruby.tar.gz -C /opt/jruby && \ |
| 16 | + rm /tmp/jruby.tar.gz && \ |
| 17 | + ln -s /opt/jruby/bin/jruby /usr/local/bin/ruby && \ |
| 18 | + apk del \ |
| 19 | + tar \ |
| 20 | + curl |
| 21 | + |
| 22 | +# set the jruby binaries in the path |
| 23 | +ENV PATH /opt/jruby/bin:$PATH |
| 24 | + |
| 25 | +# skip installing gem documentation |
| 26 | +RUN mkdir -p /opt/jruby/etc \ |
| 27 | + && { \ |
| 28 | + echo 'install: --no-document'; \ |
| 29 | + echo 'update: --no-document'; \ |
| 30 | + } >> /opt/jruby/etc/gemrc |
| 31 | + |
| 32 | +# install bundler, gem requires bash to work |
| 33 | +RUN gem install bundler |
| 34 | + |
| 35 | +# install things globally, for great justice |
| 36 | +# and don't create ".bundle" in all our apps |
| 37 | +ENV GEM_HOME /usr/local/bundle |
| 38 | +ENV BUNDLE_PATH="$GEM_HOME" \ |
| 39 | + BUNDLE_BIN="$GEM_HOME/bin" \ |
| 40 | + BUNDLE_SILENCE_ROOT_WARNING=1 \ |
| 41 | + BUNDLE_APP_CONFIG="$GEM_HOME" |
| 42 | +ENV PATH $BUNDLE_BIN:$PATH |
| 43 | +RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \ |
| 44 | + && chmod 777 "$GEM_HOME" "$BUNDLE_BIN" |
| 45 | + |
| 46 | +CMD [ "irb" ] |
0 commit comments