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

39 lines
1.3 KiB
Docker
Raw Normal View History

2014-08-12 19:56:51 -04:00
FROM buildpack-deps:jessie
ENV RUBY_MAJOR 2.1
2014-11-14 13:35:18 -05:00
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
RUN apt-get update \
&& apt-get install -y bison libgdbm-dev ruby \
2014-08-14 12:50:29 -04:00
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p /usr/src/ruby \
&& 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 \
2014-08-12 19:56:51 -04:00
&& make -j"$(nproc)" \
&& make install \
&& apt-get purge -y --auto-remove bison libgdbm-dev ruby \
&& rm -r /usr/src/ruby
# skip installing gem documentation
RUN echo 'gem: --no-rdoc --no-ri' >> "$HOME/.gemrc"
# 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" ]