tgprsw
Last Updated: February 25, 2016
·
4.397K
· igama
159f249362b6765a910afaf30573cf24

Dockerfile for RVM

Example Dockerfile to setup a environment with RVM, to be used for Ruby projects.

#Template Dockerfile for Ruby projects
FROM ubuntu:14.04

RUN apt-get update

## Default Packages
RUN apt-get install -y -q ruby1.9.1 ruby1.9.1-dev build-essential 
RUN apt-get install -y nano wget links curl rsync bc git git-core apt-transport-https libxml2 libxml2-dev libcurl4-openssl-dev openssl sqlite3 libsqlite3-dev
RUN apt-get install -y gawk libreadline6-dev libyaml-dev autoconf libgdbm-dev libncurses5-dev automake libtool bison libffi-dev

## Ruby
RUN curl -L https://get.rvm.io | bash -s stable
#Set env just in case
ENV PATH /usr/local/rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
RUN /bin/bash -l -c "rvm requirements"
RUN /bin/bash -l -c "rvm install 2.1.1"
RUN /bin/bash -l -c "gem install bundler --no-ri --no-rdoc"

## Nodejs engine is used in many projects (e.g. execjs)
RUN apt-get install -y nodejs npm
RUN ln -s  /usr/bin/nodejs  /usr/bin/node
Say Thanks
Respond

3 Responses
Add your response

17204

oh man you are running your app under root. icky

over 1 year ago ·
17562
None

its docker though.. so.. is that a big deal?

over 1 year ago ·
18137
Dd1f4e89f3ed449294179c0fdf62d958

Why do you set the PATH if you still have to use "/bin/bash -l -c"? Is there a way to use RVM and not have to use "/bin/bash -l -c" when running docker exec for example?

over 1 year ago ·