Skip to content

Instantly share code, notes, and snippets.

@mvoto
Created April 16, 2015 19:56
Show Gist options
  • Save mvoto/3d17d1bdcf1f2291a44a to your computer and use it in GitHub Desktop.
Save mvoto/3d17d1bdcf1f2291a44a to your computer and use it in GitHub Desktop.
dockerfile: base: ubuntu + nginx, rbenv and ruby 2.2.1
# Ubuntu as the base image
FROM ubuntu:trusty
# Install core tools
RUN apt-get -y update
RUN apt-get -y install git-core zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev
# Install nginx
RUN apt-get -y install curl nginx
# Install rbenv
RUN git clone https://github.com/sstephenson/rbenv.git /usr/local/rbenv
RUN echo '# rbenv setup' > /etc/profile.d/rbenv.sh
RUN echo 'export RBENV_ROOT=/usr/local/rbenv' >> /etc/profile.d/rbenv.sh
RUN echo 'export PATH="$RBENV_ROOT/bin:$PATH"' >> /etc/profile.d/rbenv.sh
RUN echo 'eval "$(rbenv init -)"' >> /etc/profile.d/rbenv.sh
RUN chmod +x /etc/profile.d/rbenv.sh
# install ruby-build
RUN mkdir /usr/local/rbenv/plugins
RUN git clone https://github.com/sstephenson/ruby-build.git /usr/local/rbenv/plugins/ruby-build
# Set rbenv path
ENV RBENV_ROOT /usr/local/rbenv
ENV PATH $RBENV_ROOT/bin:$RBENV_ROOT/shims:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
# Install ruby
RUN /bin/bash -c 'rbenv install 2.2.1'
RUN /bin/bash -c 'rbenv global 2.2.1'
@mvoto
Copy link
Author

mvoto commented Apr 16, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment