Last active
August 5, 2017 17:18
-
-
Save masoo/0cf039797caea51ce6b3 to your computer and use it in GitHub Desktop.
masoo/ubuntu-rbenv の source, Ubuntu 17.04 に rbenv をインストールした Dockerfile
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
# Pull base image. | |
FROM ubuntu:17.04 | |
MAINTAINER FUNABARA Masao | |
# Install Ruby | |
RUN \ | |
DEBIAN_FRONTEND=noninteractive apt-get update && \ | |
DEBIAN_FRONTEND=noninteractive apt-get install -y \ | |
git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev nodejs && \ | |
DEBIAN_FRONTEND=noninteractive apt-get autoremove && \ | |
DEBIAN_FRONTEND=noninteractive apt-get clean | |
RUN \ | |
DEBIAN_FRONTEND=noninteractive apt-get install -y libreadline-dev ncurses-dev zsh-common zsh sudo vim && \ | |
DEBIAN_FRONTEND=noninteractive apt-get autoremove && \ | |
DEBIAN_FRONTEND=noninteractive apt-get clean | |
RUN \ | |
useradd --create-home --shell /usr/bin/zsh --user-group --groups sudo docker && \ | |
echo "docker:docker" | chpasswd && \ | |
echo "docker ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/docker | |
RUN \ | |
DEBIAN_FRONTEND=noninteractive apt-get install -y language-pack-ja-base language-pack-ja ibus-mozc man manpages-ja && \ | |
DEBIAN_FRONTEND=noninteractive apt-get autoremove && \ | |
DEBIAN_FRONTEND=noninteractive apt-get clean && \ | |
update-locale LANG=ja_JP.UTF-8 LANGUAGE=ja_JP:ja | |
ENV LANG ja_JP.UTF-8 | |
ENV LC_ALL ja_JP.UTF-8 | |
ENV LC_CTYPE ja_JP.UTF-8 | |
USER docker | |
ENV TERM xterm | |
# Setting to Install rbenv | |
RUN \ | |
cd ~/ && \ | |
git clone git://github.com/sstephenson/rbenv.git .rbenv && \ | |
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshrc && \ | |
echo 'eval "$(rbenv init -)"' >> ~/.zshrc && \ | |
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build && \ | |
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.zshrc && \ | |
git clone https://github.com/sstephenson/rbenv-gem-rehash.git ~/.rbenv/plugins/rbenv-gem-rehash && \ | |
echo "gem: --no-ri --no-rdoc" > ~/.gemrc | |
CMD ["/usr/bin/zsh"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment