我已經有了一個我想要構建到Docker鏡像中的包,該鏡像取決於系統上的相鄰包。如何使用pip作爲docker構建的一部分來安裝本地包?
我requirements.txt
看起來是這樣的:
-e ../other_module numpy==1.0.0 flask==0.12.5
當我在打電話的virtualenv這pip install -r requirements.txt
工作正常。但是,如果我把這個在Dockerfile,如:
ADD requirements.txt /app RUN pip install -r requirements.txt
和運行使用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'嗎? – 9000
哈德你還在Docker鏡像中加入了../ other_module? – Cleared
@ 9000 @Cleared我試着用'COPY ../other_module/app'這樣的東西來複制它,但是會產生一個不同的錯誤:'構建上下文之外的禁止路徑' – AnjoMan