我正在尝试构建一个Python Docker容器。
这是我的Dockerfile:
# syntax=docker/dockerfile:1
FROM python:3.8-slim
WORKDIR /src
COPY req.ini req.ini
RUN apt-get update
RUN pip install --upgrade pip setuptools wheel
RUN pip install -r req.ini
COPY . .
CMD ["python3","flask","run","--host=0.0.0.0"]
我的req.ini文件看起来像这样:
Flask fasttext gensim nltk scipy pandas numpy
但是当我运行docker build --tag python-app时,我会收到以下错误:
#15 11.25 Building wheel for fasttext (setup.py): finished with status 'error'
#15 11.26 error: subprocess-exited-with-error
#15 11.26
#15 11.26 × python setup.py bdist_wheel did not run successfully.
#15 11.26 │ exit code: 1
#15 11.26 ╰─> [42 lines of output]
#15 11.26 ERROR: Failed building wheel for fasttext
#15 11.26 Running setup.py clean for fasttext
#15 11.38 Failed to build fasttext
#15 15.60 Running setup.py install for fasttext: finished with status 'error'
#15 15.61 error: subprocess-exited-with-error
#15 15.61
#15 15.61 × Running setup.py install for fasttext did not run successfully.
#15 15.61 │ exit code: 1
#15 15.61 ╰─> [46 lines of output]
#15 15.61 /usr/local/lib/python3.8/site-packages/setuptools/dist.py:731: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead
#15 15.61 × Encountered error while trying to install package.
#15 15.61 ╰─> fasttext
#15 15.61
#15 15.61 note: This is an issue with the package mentioned above, not pip.
------
executor failed running [/bin/sh -c pip install -r req.ini]: exit code: 1
我做错了什么?