FROM ruby:2.3
RUN sed -i's/httpredir.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list
RUN apt-get update && apt-get install -y mysql-client postgresql-client nodejs sqlite3
RUN gem sources --add https://gems.ruby-china.org/ --remove https://rubygems.org/ -v
RUN bundle config mirror.https://rubygems.org https://gems.ruby-china.org
RUN gem install rails -v5.0.0.1
当前目录下运行 docker build -t rails:v3 . 新建镜像rails:v3
docker images 查看下载的镜像
docker run -it -v ~/Documents:/apple rails:v3 bash