我需要在 anaconda docker 环境中安装一些库。下面是我的 dockerfile 和 environment.yml。我可以毫无错误地构建我的 docker,但是当我运行我的代码时,似乎 opencv 和 imutils 没有正确安装。谁能告诉我该怎么办???
dockerfile
FROM continuumio/anaconda3
WORKDIR /app
#create environment
COPY environment.yml
RUN conda env create -f environment.yml
#make run commands use the new env
SHELL ["conda", "run", "-n", "myenv", "/bin/bash", "-c"]
#make sure the env is activate
RUN echo "make sure anaconda activate"
RUN python -c "import dlib"
COPY app.py .
ENTRYPOINT ["conda", "run", "-n", "myenv", "python", "app.py"]
环境.yml
name: myenv
channels:
- conda-forge
- defaults
dependencies:
- python=3.8.5
- dlib
- pymongo
- requests
- face_recognition
- opencv
- imutils