Docker Image: Ruby on Rails with Nginx-Passenger


Official Centos 6.8:

Ruby: 2.1.7

Nodejs: v6.0.2


FROM centos:6.8
MAINTAINER Chester4096 <>
RUN yum update -y && yum install -y which rubygems git libcurl-devel epel-release npm && gem update gem && gem install bundler
RUN gpg2 — keyserver hkp:// — recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
RUN \curl -sSL | bash -s stable
ENV PATH /usr/local/rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
RUN /usr/local/rvm/bin/rvm-shell && rvm requirements
RUN /usr/local/rvm/bin/rvm-shell && rvm install 2.1.7
RUN /usr/local/rvm/bin/rvm-shell && rvm use 2.1.7 — default
RUN curl -o- | bash
RUN source /root/.bashrc && nvm install v6.2.0

Build Image

docker build -t cent0s6_8_base .

Install Rails

Go into image centos6_8_base, then install manually

docker run -it centos6_8_base
rvm use 2.1.7 — default
gem install rails — no-ri

Install Nginx + Passenger

gem install passenger

Export As Your Image

exit from docker image


see your container ID

docker ps -a 

Looks like this

Commit your changes

docker commit -m ‘$YOUR_CONTAINER_ID’ $IMAGE_NAME

Login to your Docker-Hub

docker login


docker push $IMAGE_NAME
One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.