Ruby on rails Docker Ruby 2.2.3 simply Rails应用程序

Ruby on rails Docker Ruby 2.2.3 simply Rails应用程序,ruby-on-rails,docker,dockerfile,docker-machine,Ruby On Rails,Docker,Dockerfile,Docker Machine,我在跟踪,但当我键入时,我被卡在了1点上: docker build -t demo . 我在一个名为demo的新rails文件夹中,这是一个新rails应用程序的主目录 我正在使用以下Dockerfile: FROM ruby:2.2 MAINTAINER marko@codeship.com # Install apt based dependencies required to run Rails as # well as RubyGems. As the Ruby image i

我在跟踪,但当我键入时,我被卡在了1点上:

docker build -t demo .
我在一个名为demo的新rails文件夹中,这是一个新rails应用程序的主目录

我正在使用以下Dockerfile:

FROM ruby:2.2 
MAINTAINER marko@codeship.com

# Install apt based dependencies required to run Rails as 
# well as RubyGems. As the Ruby image itself is based on a 
# Debian image, we use apt-get to install those.
RUN apt-get update && apt-get install -y \ 
  build-essential \ 
  nodejs

# Configure the main working directory. This is the base 
# directory used in any further RUN, COPY, and ENTRYPOINT 
# commands.
RUN mkdir -p /app 
WORKDIR /app

# Copy the Gemfile as well as the Gemfile.lock and install 
# the RubyGems. This is a separate step so the dependencies 
# will be cached unless changes to one of those two files 
# are made.
COPY Gemfile Gemfile.lock ./ 
RUN gem install bundler && bundle install --jobs 20 --retry 5

# Copy the main application.
COPY . ./

# Expose port 3000 to the Docker host, so we can access it 
# from the outside.
EXPOSE 3000

# The main command to run when the container starts. Also 
# tell the Rails dev server to bind to all interfaces by 
# default.
CMD ["bundle", "exec", "rails", "server", "-b", "0.0.0.0"]
我收到这个错误:

Sending build context to Docker daemon 100.4 kB
Step 1 : FROM ruby:2.2.3
 ---> a930a50e60f8
Step 2 : MAINTAINER Myself
 ---> Using cache
 ---> 3c4ae5eefe92
Step 3 : RUN apt-get update && apt-get install -y   build-essential   nodejs
 ---> Using cache
 ---> 65ecc91ac6be
Step 4 : RUN mkdir -p /dev
 ---> Using cache
 ---> 1ce330a396b6
Step 5 : WORKDIR /dev
 ---> Using cache
 ---> 9b5d130285cb
Step 6 : COPY Gemfile Gemfile.lock ./
 ---> Using cache
 ---> 14c639732ae7
Step 7 : RUN gem install bundler && bundle install --jobs 20 --retry 5
 ---> Running in 672397cecd6d
Successfully installed bundler-1.10.6
1 gem installed
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and
installing your bundle as root will break this application for all non-root
users on this machine.
Could not locate Gemfile
SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories.
The command '/bin/sh -c gem install bundler && bundle install --jobs 20 --retry 5' returned a non-zero code: 10
为什么我会出现这个错误而无法构建容器?

您的Dockerfile说

但是日志说:

Step 4 : RUN mkdir -p /dev
---> Using cache
---> 1ce330a396b6
Step 5 : WORKDIR /dev

什么是正确的/dev或/app?

任何人都可以帮助解决此问题?据我所知,bundler已成功安装,但有一条消息“找不到Gemfile”,表示工作目录中没有Gemfile。请再次检查项目中是否存在此文件?可能会有所帮助
Step 4 : RUN mkdir -p /dev
---> Using cache
---> 1ce330a396b6
Step 5 : WORKDIR /dev