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
|
2015-12-16 11:44:37 -05:00
|
|
|
ENV RUBY_VERSION 2.1.8
|
|
|
|
ENV RUBY_DOWNLOAD_SHA256 afd832b8d5ecb2e3e1477ec6a9408fdf9898ee73e4c5df17a2b2cb36bd1c355d
|
2015-12-14 14:17:18 -05:00
|
|
|
ENV RUBYGEMS_VERSION 2.5.1
|
2014-08-12 16:16:33 -04:00
|
|
|
|
2015-08-07 13:56:20 -04:00
|
|
|
# skip installing gem documentation
|
|
|
|
RUN echo 'install: --no-document\nupdate: --no-document' >> "$HOME/.gemrc"
|
|
|
|
|
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 \
|
2015-08-07 13:56:20 -04:00
|
|
|
&& gem update --system $RUBYGEMS_VERSION \
|
2014-08-12 16:16:33 -04:00
|
|
|
&& rm -r /usr/src/ruby
|
|
|
|
|
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
|
2015-06-12 14:06:36 -04:00
|
|
|
|
2015-12-16 11:44:10 -05:00
|
|
|
ENV BUNDLER_VERSION 1.11.2
|
2015-06-12 14:06:36 -04:00
|
|
|
|
|
|
|
RUN gem install bundler --version "$BUNDLER_VERSION" \
|
2014-10-17 20:26:08 -04:00
|
|
|
&& bundle config --global path "$GEM_HOME" \
|
2016-01-15 22:35:36 -05:00
|
|
|
&& bundle config --global bin "$GEM_HOME/bin" \
|
|
|
|
&& bundle config --global silence_root_warning true
|
2014-10-17 20:26:08 -04:00
|
|
|
|
|
|
|
# don't create ".bundle" in all our apps
|
|
|
|
ENV BUNDLE_APP_CONFIG $GEM_HOME
|
2014-08-12 20:09:49 -04:00
|
|
|
|
|
|
|
CMD [ "irb" ]
|