我正在为我的应用程序部署一个 docker 解决方案。在我的 docker 文件中,我使用了多个 conda-forge 来构建一些容器。它对某些容器工作得很好,而对另一个容器则给出了错误,我确信这与包无关,因为对于同一个包,有时它可以工作,而其他人则不行。
我曾尝试使用 pip 而不是 conda,但这会导致其他错误,因为我最初将 conda 用于我的所有配置。另外,我读到这RUN conda update --all
将解决它,并用于 pip 设置RUN pip install --upgrade setuptools
这是我的 docker 文件的一部分:
FROM dockerreg.cyanoptics.com/cyan/openjdk-java8:1.0.0
RUN conda update --all
RUN conda install -c conda-forge happybase=1.1.0 --yes
RUN conda install -c conda-forge requests-kerberos
RUN pip install --upgrade setuptools
RUN pip install --upgrade pip
RUN pip install kafka-python
RUN pip install requests-negotiate
预期结果是成功构建所有容器,但我得到以下结果:
---> Using cache
---> 82f4cd49037d
Step 14 : RUN conda install -c conda-forge happybase=1.1.0 --yes
---> Using cache
---> c035b960aa3b
Step 15 : RUN conda install -c conda-forge requests-kerberos
---> Running in 54d869afcd00
Traceback (most recent call last):
File "/opt/conda/bin/conda", line 7, in <module>
from conda.cli import main
ModuleNotFoundError: No module named 'conda'
The command '/bin/sh -c conda install -c conda-forge requests-
kerberos' returned a non-zero code: 1
make: *** [dockerimage] Error 1