在Windows 7上的Docker撰写:找不到Gemfile或.bundle /目录
当我运行docker-compose up
命令时出现以下错误
找不到Gemfile或.bundle /目录
退出代码10
以下是代码。
注意:我已经使用Oracle VM虚拟框pipe理器将我的代码的父目录作为永久共享文件夹添加到VM。
任何想法来解决这个问题。
Dockerfile
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撰写
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
您正在容器中创build.bundle
目录,然后使用主目录对其进行掩码,因为您正在使用卷:
volumes: - .:/student-api
您需要在主机上运行bundle install
,或者从Compose文件中删除卷。
你是否在你的HOMEpath中挂载HOST目录(例如c:/ Users / john / *)。
请注意,在HOMEpath外面执行此操作无法正常工作。
- 如何在单个主机上运行Docker容器池,在重新启动时保留其IP地址?
- 强大的云主机上的Pycharm – Docker图像作为远程解释器?
- 马拉松 – 当返回码= 0时不要重新部署应用程序?
- Docker映像作为多个服务器的操作系统
- Rancher服务器中的集中式日志logging和容器生产监控
- 在Dockerfile中保持configuration? 而且这个图像制作是否安全?
- dockerfile java.lang.NumberFormatException:对于inputstring:“5B [”
- bitbucket docker权限被拒绝(publickey)。 致命的:无法从远程存储库读取
- 我如何configuration泊坞窗拉取图像只是从我的私人存储库,而不是docker.io?