Public Repository

Last pushed: 2 years ago
Short Description
rbenv and ruby-build setup with ubuntu 14.04 base
Full Description


FROM ubuntu:14.04

RUN apt-get update && apt-get install -y \
      curl \
    nano \
    git-core \
    git \
    nodejs \
    autoconf bison build-essential libssl-dev \
    libyaml-dev libreadline6-dev zlib1g-dev \
    libncurses5-dev libffi-dev libgdbm3 libgdbm-dev \  
 && rm -rf /var/lib/apt/lists/*

RUN useradd -ms /bin/bash rails

USER rails

ENV MYHOME=/home/rails

# install rbenv and ruby-build

RUN git clone $MYHOME/.rbenv

RUN echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> $MYHOME/.bash_profile

RUN echo 'eval "$(rbenv init -)"' >> $MYHOME/.bash_profile

RUN git clone $MYHOME/.rbenv/plugins/ruby-build

# when docker run, cd to $HOME and set up rbenv for the first time based on

# after choosing ruby version and installed it, add rails gem and put your app in /home/rails/app


EXPOSE 3000 3001

CMD ["rails", "s", "-b", ""]

When docker run for the first time then:

 cd /home/rails && .rbenv/bin/rbenv && source .bash_profile

After installing ruby and Rails,

rails new app # options
Docker Pull Command

Comments (0)