Skip to content

Commit c7bf9b8

Browse files
committed
Merge pull request #28 from misfo/2.2
Ruby 2.2 Dockerfiles
2 parents 11c5f34 + 07f3513 commit c7bf9b8

File tree

3 files changed

+87
-0
lines changed

3 files changed

+87
-0
lines changed

2.2/Dockerfile

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
FROM buildpack-deps:jessie
2+
3+
RUN apt-get update && apt-get install -y curl procps && rm -rf /var/lib/apt/lists/*
4+
5+
ENV RUBY_MAJOR 2.2
6+
ENV RUBY_VERSION 2.2.0-preview2
7+
8+
# some of ruby's build scripts are written in ruby
9+
# we purge this later to make sure our final image uses what we just built
10+
RUN apt-get update \
11+
&& apt-get install -y bison ruby \
12+
&& rm -rf /var/lib/apt/lists/* \
13+
&& mkdir -p /usr/src/ruby \
14+
&& curl -SL "http://cache.ruby-lang.org/pub/ruby/$RUBY_MAJOR/ruby-$RUBY_VERSION.tar.bz2" \
15+
| tar -xjC /usr/src/ruby --strip-components=1 \
16+
&& cd /usr/src/ruby \
17+
&& autoconf \
18+
&& ./configure --disable-install-doc \
19+
&& make -j"$(nproc)" \
20+
&& apt-get purge -y --auto-remove bison ruby \
21+
&& make install \
22+
&& rm -r /usr/src/ruby
23+
24+
# skip installing gem documentation
25+
RUN echo 'gem: --no-rdoc --no-ri' >> "$HOME/.gemrc"
26+
27+
# install things globally, for great justice
28+
ENV GEM_HOME /usr/local/bundle
29+
ENV PATH $GEM_HOME/bin:$PATH
30+
RUN gem install bundler \
31+
&& bundle config --global path "$GEM_HOME" \
32+
&& bundle config --global bin "$GEM_HOME/bin"
33+
34+
# don't create ".bundle" in all our apps
35+
ENV BUNDLE_APP_CONFIG $GEM_HOME
36+
37+
CMD [ "irb" ]

2.2/onbuild/Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM ruby:2.2.0-preview2
2+
3+
# throw errors if Gemfile has been modified since Gemfile.lock
4+
RUN bundle config --global frozen 1
5+
6+
RUN mkdir -p /usr/src/app
7+
WORKDIR /usr/src/app
8+
9+
ONBUILD COPY Gemfile /usr/src/app/
10+
ONBUILD COPY Gemfile.lock /usr/src/app/
11+
ONBUILD RUN bundle install
12+
13+
ONBUILD COPY . /usr/src/app

2.2/wheezy/Dockerfile

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
FROM buildpack-deps:wheezy
2+
3+
RUN apt-get update && apt-get install -y curl procps && rm -rf /var/lib/apt/lists/*
4+
5+
ENV RUBY_MAJOR 2.2
6+
ENV RUBY_VERSION 2.2.0-preview2
7+
8+
# some of ruby's build scripts are written in ruby
9+
# we purge this later to make sure our final image uses what we just built
10+
RUN apt-get update \
11+
&& apt-get install -y bison ruby \
12+
&& rm -rf /var/lib/apt/lists/* \
13+
&& mkdir -p /usr/src/ruby \
14+
&& curl -SL "http://cache.ruby-lang.org/pub/ruby/$RUBY_MAJOR/ruby-$RUBY_VERSION.tar.bz2" \
15+
| tar -xjC /usr/src/ruby --strip-components=1 \
16+
&& cd /usr/src/ruby \
17+
&& autoconf \
18+
&& ./configure --disable-install-doc \
19+
&& make -j"$(nproc)" \
20+
&& apt-get purge -y --auto-remove bison ruby \
21+
&& make install \
22+
&& rm -r /usr/src/ruby
23+
24+
# skip installing gem documentation
25+
RUN echo 'gem: --no-rdoc --no-ri' >> "$HOME/.gemrc"
26+
27+
# install things globally, for great justice
28+
ENV GEM_HOME /usr/local/bundle
29+
ENV PATH $GEM_HOME/bin:$PATH
30+
RUN gem install bundler \
31+
&& bundle config --global path "$GEM_HOME" \
32+
&& bundle config --global bin "$GEM_HOME/bin"
33+
34+
# don't create ".bundle" in all our apps
35+
ENV BUNDLE_APP_CONFIG $GEM_HOME
36+
37+
CMD [ "irb" ]

0 commit comments

Comments
 (0)