Created
April 16, 2015 19:56
-
-
Save mvoto/3d17d1bdcf1f2291a44a to your computer and use it in GitHub Desktop.
dockerfile: base: ubuntu + nginx, rbenv and ruby 2.2.1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
References: