Windows 7上的Docker Compose:无法找到Gemfile或.bundle /目录 [英] Docker Compose on Windows 7: Could not locate Gemfile or .bundle/ directory
问题描述
运行命令 docker-compose up
我遇到以下错误定位Gemfile或.bundle /目录
以代码10退出
Could not locate Gemfile or .bundle/ directory
exited with code 10
下面是代码。
注意:我已经使用Oracle VM虚拟框管理器将代码的父目录作为永久共享文件夹添加到VM。
Note : I have added the parent directory of my code as a permanent shared folder to the VM using Oracle VM virtual box manager.
有什么想法可以解决此问题。?
Any thoughts to resolve the issue.?
FROM ruby:2.3.0
ENV HTTP_PROXY http://proxy.com:8080
ENV HTTPS_PROXY http://proxy.com:8080
RUN mkdir /student-api
WORKDIR /student-api
ADD Gemfile /student-api/Gemfile
ADD Gemfile.lock /student-api/Gemfile.lock
RUN bundle install
ADD . /student-api
Docker Compose
db:
image: postgres
ports:
- "5432:5432"
web:
build: .
command: bundle exec rails s -p 3000 -b '0.0.0.0'
volumes:
- .:/student-api
ports:
- "3000:3000"
links:
- db
推荐答案
您正在容器中创建 .bundle
目录,然后使用主机目录对其进行屏蔽,因为您使用的是卷:
You are creating the .bundle
directory in the container, then masking it with the host directory , because you're using a volume:
volumes:
- .:/student-api
您需要在主机上运行捆绑安装
,或从Compose文件中删除该卷。
You need to either run the bundle install
on the host, or remove the volume from the Compose file.
这篇关于Windows 7上的Docker Compose:无法找到Gemfile或.bundle /目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!