Skip to content

Commit 9ebdc9a

Browse files
committed
Simple Dockerfiles to make ruby from source tarball
0 parents  commit 9ebdc9a

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

Dockerfile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
FROM buildpack-deps
2+
3+
ENV RUBY_MAJOR 2.1
4+
ENV RUBY_VERSION 2.1.2
5+
6+
# some of ruby's build scripts are written in ruby
7+
# we purge this later to make sure our final image uses what we just built
8+
RUN apt-get update \
9+
&& apt-get install -y bison curl ruby procps \
10+
&& mkdir -p /usr/src/ruby \
11+
&& curl -SL "http://cache.ruby-lang.org/pub/ruby/$RUBY_MAJOR/ruby-$RUBY_VERSION.tar.bz2" \
12+
| tar -xjC /usr/src/ruby --strip-components=1 \
13+
&& cd /usr/src/ruby \
14+
&& autoconf \
15+
&& ./configure --disable-install-doc \
16+
&& make -j"${nproc}" \
17+
&& apt-get purge -y bison ruby procps \
18+
&& apt-get autoremove -y \
19+
&& make install \
20+
&& rm -r /usr/src/ruby
21+
22+
# skip installing gem documentation
23+
RUN echo 'gem: --no-rdoc --no-ri' >> /.gemrc
24+
25+
RUN gem install bundler

onbuild/Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM ruby:2.1.2
2+
3+
RUN mkdir -p /usr/src/app
4+
WORKDIR /usr/src/app
5+
6+
ONBUILD ADD Gemfile /usr/src/app/
7+
ONBUILD ADD Gemfile.lock /usr/src/app/
8+
ONBUILD RUN bundle install --system
9+
10+
ONBUILD ADD . /usr/src/app

0 commit comments

Comments
 (0)