Skip to content

Instantly share code, notes, and snippets.

@ippa
Created June 23, 2014 07:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ippa/0b7ea8692f1ae94e5722 to your computer and use it in GitHub Desktop.
Save ippa/0b7ea8692f1ae94e5722 to your computer and use it in GitHub Desktop.
rvm as normal user (non-root) Dockerfile
FROM ubuntu:trusty
MAINTAINER ippa
ENV DEBIAN_FRONTEND noninteractive
RUN unset HISTFILE
# required by RVM
RUN apt-get -y update
RUN apt-get -y install patch gawk g++ gcc make libc6-dev patch libreadline6-dev zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 autoconf libgdbm-dev libncurses5-dev automake libtool bison pkg-config libffi-dev
RUN apt-get -y install curl
# create user 'ruby' and install all rvm-stuff as that user
RUN useradd --create-home --shell /bin/bash --user-group ruby
RUN su ruby -c "curl -sSL https://get.rvm.io | bash -s stable --ruby"
RUN su -l ruby -s /bin/bash --login && \
/bin/bash -l /home/ruby/.rvm/bin/rvm reload && \
/bin/bash -l /home/ruby/.rvm/bin/rvm use --default 2.1.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment