Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

Commit

Permalink
Merge pull request #3 from promptworks/refactor-to-script
Browse files Browse the repository at this point in the history
Move install code to external script
  • Loading branch information
justincampbell committed Mar 5, 2014
2 parents a41305b + f1ae590 commit 0483648
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 18 deletions.
20 changes: 2 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,8 @@
FROM centos
MAINTAINER PromptWorks <team@promptworks.com>

RUN export RUBY_INSTALL_VERSION=0.4.0 && \
export RUBY_VERSION=2.0.0-p451 && \
cd /tmp && \
yum list installed | cut -f 1 -d " " | uniq | sort > /tmp/pre && \
yum install git -y && \
wget -O ruby-install-$RUBY_INSTALL_VERSION.tar.gz \
https://github.com/postmodern/ruby-install/archive/v$RUBY_INSTALL_VERSION.tar.gz && \
tar -xzf ruby-install-$RUBY_INSTALL_VERSION.tar.gz && \
cd ruby-install-$RUBY_INSTALL_VERSION && \
make install && \
ruby-install -i /usr/local ruby $RUBY_VERSION && \
make uninstall && \
yum list installed | cut -f 1 -d " " | uniq | sort > /tmp/post && \
diff /tmp/pre /tmp/post | grep "^>" | cut -f 2 -d ' ' | \
xargs echo yum erase -y && \
yum clean all && \
rm -rf /usr/local/src/ruby* && \
rm -rf /tmp/*
ADD install_ruby.sh /tmp/
RUN /tmp/install_ruby.sh

RUN gem update --system --no-document
RUN gem install bundler --no-ri --no-rdoc
23 changes: 23 additions & 0 deletions install_ruby.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash -ex

export RUBY_INSTALL_VERSION=0.4.0
export RUBY_VERSION=2.0.0-p451

cd /tmp

yum list installed | cut -f 1 -d " " | uniq | sort > /tmp/pre
yum install git -y

wget -O ruby-install-$RUBY_INSTALL_VERSION.tar.gz \
https://github.com/postmodern/ruby-install/archive/v$RUBY_INSTALL_VERSION.tar.gz
tar -xzf ruby-install-$RUBY_INSTALL_VERSION.tar.gz
cd ruby-install-$RUBY_INSTALL_VERSION
make install
ruby-install -i /usr/local ruby $RUBY_VERSION

make uninstall
yum list installed | cut -f 1 -d " " | uniq | sort > /tmp/post
diff /tmp/pre /tmp/post | grep "^>" | cut -f 2 -d ' ' | xargs echo yum erase -y
yum clean all
rm -rf /usr/local/src/ruby*
rm -rf /tmp/*

0 comments on commit 0483648

Please sign in to comment.