2014-08-12 19:56:51 -04:00
|
|
|
FROM buildpack-deps:jessie
|
2014-08-12 16:16:33 -04:00
|
|
|
|
|
|
|
ENV RUBY_MAJOR 2.1
|
2014-11-14 13:35:18 -05:00
|
|
|
ENV RUBY_VERSION 2.1.5
|
2015-03-23 16:34:12 -04:00
|
|
|
ENV RUBY_DOWNLOAD_SHA256 4305cc6ceb094df55210d83548dcbeb5117d74eea25196a9b14fa268d354b100
|
2014-08-12 16:16:33 -04:00
|
|
|
|
|
|
|
# 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
|
|
|
|
RUN apt-get update \
|
2015-01-21 16:23:43 -05:00
|
|
|
&& apt-get install -y bison libgdbm-dev ruby \
|
2014-08-14 12:50:29 -04:00
|
|
|
&& rm -rf /var/lib/apt/lists/* \
|
2014-08-12 16:16:33 -04:00
|
|
|
&& mkdir -p /usr/src/ruby \
|
2015-03-23 16:34:12 -04:00
|
|
|
&& 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 \
|
2014-08-12 16:16:33 -04:00
|
|
|
&& cd /usr/src/ruby \
|
|
|
|
&& autoconf \
|
|
|
|
&& ./configure --disable-install-doc \
|
2014-08-12 19:56:51 -04:00
|
|
|
&& make -j"$(nproc)" \
|
2014-08-12 16:16:33 -04:00
|
|
|
&& make install \
|
2015-01-21 16:23:43 -05:00
|
|
|
&& apt-get purge -y --auto-remove bison libgdbm-dev ruby \
|
2014-08-12 16:16:33 -04:00
|
|
|
&& rm -r /usr/src/ruby
|
|
|
|
|
|
|
|
# skip installing gem documentation
|
2014-10-17 20:26:08 -04:00
|
|
|
RUN echo 'gem: --no-rdoc --no-ri' >> "$HOME/.gemrc"
|
2014-08-12 16:16:33 -04:00
|
|
|
|
2014-10-17 20:26:08 -04:00
|
|
|
# install things globally, for great justice
|
|
|
|
ENV GEM_HOME /usr/local/bundle
|
|
|
|
ENV PATH $GEM_HOME/bin:$PATH
|
|
|
|
RUN gem install bundler \
|
|
|
|
&& 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
|
2014-08-12 20:09:49 -04:00
|
|
|
|
|
|
|
CMD [ "irb" ]
|