Created
November 3, 2016 08:31
-
-
Save upinetree/40ec52cd551d6b237edfb17c9533cdee to your computer and use it in GitHub Desktop.
Use rbenv on ubuntu (memo for the case that could not use a ruby image for some reason)
This file contains 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
FROM ubuntu | |
# prepare packages | |
RUN apt-get update \ | |
&& apt-get upgrade -y \ | |
&& apt-get install -y git \ | |
&& apt-get build-dep -y ruby | |
# set timezone | |
RUN echo "Asia/Tokyo" > /etc/timezone \ | |
&& dpkg-reconfigure -f noninteractive tzdata | |
# set locale | |
RUN /usr/sbin/locale-gen ja_JP.UTF-8 | |
# add login user | |
RUN useradd -m -G sudo ubuntu | |
USER ubuntu | |
# install rbenv | |
RUN git clone https://github.com/rbenv/rbenv.git ~/.rbenv \ | |
&& git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build \ | |
&& echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile \ | |
&& echo 'eval "$(rbenv init -)"' >> ~/.bash_profile | |
# install ruby | |
RUN bash -l -c "rbenv install 2.3.1" | |
EXPOSE 80 | |
CMD ["echo", "hello"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment