opencv and imutils are not working correctly in my docker

  anaconda, docker, imutils, opencv, python

I need to install some libraries in an anaconda docker environment. Below are my dockerfile and environment.yml.
I can build my docker without error but when I run my code it seems opencv and imutils not correctly installed. anyone can tell me what should I do???
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"]
##############################################################################
environment.yml
name: myenv
channels:

  • conda-forge
  • defaults
    dependencies:
  • python=3.8.5
  • dlib
  • pymongo
  • requests
  • face_recognition
  • opencv
  • imutils

Source: Docker Questions

LEAVE A COMMENT