Python 3.x &引用;未能生成regex";当docker';s的形象;python:3.5-alpine“;建成
我正在尝试使用以下dockerfile构建python的docker映像: 你能帮我澄清一下吗Python 3.x &引用;未能生成regex";当docker';s的形象;python:3.5-alpine“;建成,python-3.x,docker,Python 3.x,Docker,我正在尝试使用以下dockerfile构建python的docker映像: 你能帮我澄清一下吗 FROM python:3.5-alpine COPY sa /app WORKDIR /app RUN pip3 install -r requirements.txt && \ python3 -m textblob.download_corpora EXPOSE 6000 ENTRYPOINT ["python3"] CMD ["sentiment_analysis.py"
FROM python:3.5-alpine
COPY sa /app
WORKDIR /app
RUN pip3 install -r requirements.txt && \
python3 -m textblob.download_corpora
EXPOSE 6000
ENTRYPOINT ["python3"]
CMD ["sentiment_analysis.py"]
当我尝试构建时,我遇到了以下错误:
Building wheel for regex (setup.py): started
**Building wheel for regex (setup.py): finished with status 'error**'
ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-uf5dc85t/regex/setup.py'"'"'; __file__='"'"'/tmp/pip-install-uf5dc85t/regex/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-soszwszs
cwd: /tmp/pip-install-uf5dc85t/regex/
Complete output (17 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.5
creating build/lib.linux-x86_64-3.5/regex
copying regex_3/__init__.py -> build/lib.linux-x86_64-3.5/regex
copying regex_3/regex.py -> build/lib.linux-x86_64-3.5/regex
copying regex_3/_regex_core.py -> build/lib.linux-x86_64-3.5/regex
copying regex_3/test_regex.py -> build/lib.linux-x86_64-3.5/regex
running build_ext
building 'regex._regex' extension
creating build/temp.linux-x86_64-3.5
creating build/temp.linux-x86_64-3.5/regex_3
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict- prototypes -fPIC -I/usr/local/include/python3.5m -c regex_3/_regex.c -o build/temp.linux-x86_64-3.5/regex_3/_regex.o
unable to execute 'gcc': No such file or directory
error: command 'gcc' failed with exit status 1
----------------------------------------
**ERROR: Failed building wheel for regex**
Running setup.py clean for regex
Successfully built nltk MarkupSafe
Failed to build regex
建议添加
后,在FROM指令之后立即运行apk add build base
——它可以工作!谢谢你,斯蒂法诺 未安装gcc。尝试添加运行apk add build base
,就在FROM directiveStefano之后,非常感谢,现在它可以工作了祝你今天愉快!