Public Repository

Last pushed: 8 months ago
Short Description
rbenv a tool for managing ruby versions
Full Description

Build

docker build -t rbenv .

You can build custom versions of this image with specific version of ruby installed by default using the following build command:

docker build --build-args RUBY_VERSION=version -t rbenv:version .

Supported tags

  • latest: rbenv only no ruby installed by default
  • 2.2.3: rbenv with ruby 2.2.3 installed by default

Dockerfile

FROM ubuntu:latest

ENV HOME /root

WORKDIR $HOME

# Add apt repository needed
RUN echo 'deb http://archive.ubuntu.com/ubuntu xenial main universe' > /etc/apt/sources.list  && \
    echo 'deb http://archive.ubuntu.com/ubuntu xenial-security main universe' >> /etc/apt/sources.list && \
    echo 'deb http://archive.ubuntu.com/ubuntu xenial-updates main universe' >> /etc/apt/sources.list && \
    echo 'deb http://archive.ubuntu.com/ubuntu xenial-backports main restricted universe multiverse' >> /etc/apt/sources.list && \
    echo 'deb-src http://archive.ubuntu.com/ubuntu xenial main universe' >> /etc/apt/sources.list && \
    echo 'deb-src http://archive.ubuntu.com/ubuntu xenial-security main universe' >> /etc/apt/sources.list && \
    echo 'deb-src http://archive.ubuntu.com/ubuntu xenial-updates main universe' >> /etc/apt/sources.list && \
    echo 'deb-src http://archive.ubuntu.com/ubuntu xenial-backports main restricted universe multiverse' >> /etc/apt/sources.list && \
    apt-get update && \
    apt-get install -y --no-install-recommends \
      ca-certificates \
      fakeroot \
      software-properties-common \
      build-essential \
      git \
      curl \
      wget \
      autoconf \
      libpq-dev \
      libsqlite3-dev \
      libmysqlclient-dev \
      zlib1g-dev \
      libssl-dev \
      libreadline-dev \
      libyaml-dev \
      libxml2-dev \
      libxslt-dev && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Install rbenv
RUN git clone https://github.com/sstephenson/rbenv.git $HOME/.rbenv && \
    echo 'eval "$(rbenv init -)"' >> /etc/profile.d/rbenv.sh && \
    echo 'eval "$(rbenv init -)"' >> $HOME/.bashrc

# Install ruby-build
RUN git clone https://github.com/sstephenson/ruby-build.git $HOME/.rbenv/plugins/ruby-build && \
    $HOME/.rbenv/plugins/ruby-build/install.sh

ENV PATH $HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH

# Install ruby version if specified
ARG RUBY_VERSION

RUN if [ ${RUBY_VERSION} ]; then $HOME/.rbenv/bin/rbenv install $RUBY_VERSION && $HOME/.rbenv/bin/rbenv global $RUBY_VERSION; fi
Docker Pull Command
Owner
quasipresence