我新建了一个 rails 的项目,然后在里面写了 Dockerfile
FROM ubuntu:16.04
MAINTAINER Peter <[email protected]>
RUN sed -i s@/archive.ubuntu.com/@/mirrors.163.com/@g /etc/apt/sources.list
RUN apt-get update && apt-get install curl --assume-yes
RUN curl -L get.rvm.io | bash -s stable
RUN /bin/bash -c "source /etc/profile.d/rvm.sh"
RUN /bin/bash -l -c "rvm requirements"
RUN /bin/bash -l -c "rvm install 2.3.1"
RUN /bin/bash -l -c "gem install bundler --no-ri --no-rdoc"
EXPOSE 3000
ENV APP_HOME /app
RUN mkdir -p $APP_HOME
WORKDIR $APP_HOME
COPY Gemfile $APP_HOME/
COPY Gemfile.lock $APP_HOME/
RUN /bin/bash -l -c "bundle install"
COPY ./ $APP_HOME
$ docker build .
装了半天,build 完之后想进入容器看看状况
docker run -t 334c6630becf
进去之后,敲任何命令都没效果了
root@3485109d9ad8:/app#