Skip to content

Instantly share code, notes, and snippets.

@MichaelSp
Created May 12, 2015 14:05
Show Gist options
  • Save MichaelSp/6219cb8230129c080651 to your computer and use it in GitHub Desktop.
Save MichaelSp/6219cb8230129c080651 to your computer and use it in GitHub Desktop.
FROM ubuntu:14.04
RUN apt-get update && apt-get --force-yes -y --no-install-recommends upgrade
RUN apt-get install --force-yes -y --no-install-recommends \
mysql-client postgresql-client sqlite3 nodejs curl git \
build-essential libssl-dev ca-certificates libmysqlclient-dev \
libxslt1-dev libxml2 libxml2-dev libpq-dev libevent-dev libreadline-dev \
&& rm -rf /var/lib/apt/lists/*
# Install rbenv and ruby-build
RUN git clone https://github.com/sstephenson/rbenv.git /root/.rbenv
RUN git clone https://github.com/sstephenson/ruby-build.git /root/.rbenv/plugins/ruby-build
RUN git clone https://github.com/sstephenson/rbenv-gem-rehash.git /root/.rbenv/plugins/rbenv-gem-rehash
ENV PATH /root/.rbenv/bin:$PATH
RUN echo 'eval "$(rbenv init -)"' >> /etc/profile.d/rbenv.sh # or /etc/profile
RUN echo 'eval "$(rbenv init -)"' >> ~/.bashrc
# Install a version of ruby
ENV INSTALL_RUBY_VERSION 2.2.2
RUN rbenv install $INSTALL_RUBY_VERSION
# Install Bundler for each version of ruby
RUN echo 'gem: --no-rdoc --no-ri' >> ~/.gemrc
RUN bash -l -c 'for v in $(rbenv versions --bare); do rbenv global $v; echo "Install bundler for ruby $v";gem install bundler; done'
WORKDIR /app
ADD Gemfile /app/Gemfile
ADD Gemfile.lock /app/Gemfile.lock
RUN bash -l -c "bundle install && rm -rf /app/Gemfile /app/Gemfile.lock"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment