【发布时间】:2017-11-26 06:27:41
【问题描述】:
我有一个包,我想将它构建到一个依赖于我系统上相邻包的 docker 映像中。
我的requirements.txt 看起来像这样:
当我在 virtualenv 中调用 pip install -r requirements.txt 时,它可以正常工作。但是,如果我在 Dockerfile 中调用它,例如:
并使用docker build . 运行我收到一条错误消息:
../other_module should either be a path to a local project or a VCS url beginning with svn+, git+, hg+, or bzr+
如果有的话,我在这里做错了什么?
【问题讨论】:
-
你的 Docker 镜像中有
other_module吗? -
你是否也将
../other_module添加到 docker 映像中? -
@9000 @Cleared 我尝试使用类似
COPY ../other_module /app的方式复制它,但这会产生不同的错误:Forbidden path outside the build context