Skip to content

Instantly share code, notes, and snippets.

@tcnksm
Last active October 20, 2015 13:30
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save tcnksm/9389036 to your computer and use it in GitHub Desktop.
FROM ubuntu
# Install basic packages
RUN apt-get update
RUN apt-get install -y build-essential wget curl git
RUN apt-get install -y zlib1g-dev libssl-dev libreadline-dev libyaml-dev libxml2-dev libxslt-dev
RUN apt-get install -y sqlite3 libsqlite3-dev
RUN apt-get clean
# 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 ./root/.rbenv/plugins/ruby-build/install.sh
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 multiple versions of ruby
ENV CONFIGURE_OPTS --disable-install-doc
RUN rbenv install 2.1.0
# Install Bundler for each version of ruby
RUN echo 'gem: --no-rdoc --no-ri' >> /.gemrc
RUN bash -l -c 'rbenv global 2.1.0; gem update; gem install bundler'
# Add application
RUN mkdir /myapp
WORKDIR /myapp
ADD my_rails_app/Gemfile /myapp/Gemfile
RUN bash -l -c 'bundle install'
ADD my_rails_app /myapp
ENTRYPOINT ["bash", "-l", "-c"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment