我想构建一个具有scikit-learn,opencv和numpy的python docker容器。 不幸的是,我找不到包含所有这些内容的预制容器,但是我确实找到了下面包含numpy和scikit-learn的容器。
我仍然需要安装opencv,因此在我的docker文件中,我包括了RUN pip install opencv-python 。 但是,我继续收到以下错误:
Could not find a version that satisfies the requirement opencv-python (from version: ) No matching distribution found for opencv-python
我在网上阅读的每件事都说pip install opencv-python可以工作,但是由于某种原因它对我不起作用。 python包可能有问题吗?
任何帮助表示赞赏
另外,我将在下面包括完整的Dockerfile,我的目标是使用openFaas,这是一个无服务器的框架,因此我的Dockerfile可能看起来很奇怪:
FROM frolvlad/alpine-python-machinelearning
RUN apk update
RUN apk upgrade
# Alternatively use ADD https:// (which will not be cached by Docker builder)
RUN apk --no-cache add curl \
&& echo "Pulling watchdog binary from Github." \
&& curl -sSL
https://github.com/openfaas/faas/releases/download/0.8.0/fwatchdog > /usr/bin/fwatchdog \
&& chmod +x /usr/bin/fwatchdog \
&& apk del curl --no-cache
# Add non root user
RUN addgroup -S app && adduser -S -g app app
RUN chown app /home/app
RUN pip install -U pip
USER app
ENV PATH=$PATH:/home/app/.local/bin
WORKDIR /home/app/
RUN pip install opencv-python
RUN mkdir -p function
RUN touch ./function/__init__.py
WORKDIR /home/app/function/
RUN pip install --user app opencv-python
WORKDIR /home/app/
COPY function function
ENV fprocess="python index.py"
HEALTHCHECK --interval=1s CMD [ -e /tmp/.lock ] || exit 1
CMD ["fwatchdog"]