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

Move install code to external script #3

Merged
merged 1 commit into from
Mar 5, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/*