Невозможно контейнировать колбу микросервисом. Я пролистал страницы GitHub, описывающие способы решения этой ошибки, но, похоже, ничего не работает. Я пробовал разные среды выполнения python3.X-alpine, но все еще одно и то же. Я не могу понять, почему журналы сообщают мне об ошибке : команда 'gcc' завершилась неудачно с состоянием выхода 1 , когда я добавил необходимые политики GCC.
Dockerfile
FROM python:3.7.4-alpine
RUN apk add --no-cache --virtual .build-deps gcc musl-dev \
&& pip install cython \
&& apk del .build-deps
RUN mkdir /app
WORKDIR /app
COPY . /app
RUN pip install -r requirements.txt --default-timeout=100 future
EXPOSE 5000
CMD ["python3", "app.py"]
Ошибка
command: /usr/local/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ohfwxr4o/typed-ast/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ohfwxr4o/typed-ast/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-6vb5bz2_ --python-tag cp37
cwd: /tmp/pip-install-ohfwxr4o/typed-ast/
Complete output (23 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.7
creating build/lib.linux-x86_64-3.7/typed_ast
copying typed_ast/ast3.py -> build/lib.linux-x86_64-3.7/typed_ast
copying typed_ast/conversions.py -> build/lib.linux-x86_64-3.7/typed_ast
copying typed_ast/ast27.py -> build/lib.linux-x86_64-3.7/typed_ast
copying typed_ast/__init__.py -> build/lib.linux-x86_64-3.7/typed_ast
package init file 'ast3/tests/__init__.py' not found (or not a regular file)
creating build/lib.linux-x86_64-3.7/typed_ast/tests
copying ast3/tests/test_basics.py -> build/lib.linux-x86_64-3.7/typed_ast/tests
running build_ext
building '_ast27' extension
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/ast27
creating build/temp.linux-x86_64-3.7/ast27/Parser
creating build/temp.linux-x86_64-3.7/ast27/Python
creating build/temp.linux-x86_64-3.7/ast27/Custom
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -DTHREAD_STACK_SIZE=0x100000 -fPIC -Iast27/Include -I/usr/local/include/python3.7m -c ast27/Parser/acceler.c -o build/temp.linux-x86_64-3.7/ast27/Parser/acceler.o
unable to execute 'gcc': No such file or directory
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for typed-ast
Running setup.py clean for typed-ast
Building wheel for wrapt (setup.py): started
Building wheel for wrapt (setup.py): finished with status 'done'
Created wheel for wrapt: filename=wrapt-1.11.2-cp37-none-any.whl size=19592 sha256=82243e530eafb10da7c6b0645a61b8808dcb9136c0e5787bc6c161172f7ca90d
Stored in directory: /root/.cache/pip/wheels/d7/de/2e/efa132238792efb6459a96e85916ef8597fcb3d2ae51590dfd
Successfully built future MarkupSafe wrapt
Failed to build typed-ast
Installing collected packages: future, aniso8601, wrapt, lazy-object-proxy, six, typed-ast, astroid, Click, MarkupSafe, Jinja2, itsdangerous, Werkzeug, Flask, pytz, Flask-RESTful, isort, mccabe, pylint
Running setup.py install for typed-ast: started
Running setup.py install for typed-ast: 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-ohfwxr4o/typed-ast/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ohfwxr4o/typed-ast/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-glxx7aqy/install-record.txt --single-version-externally-managed --compile
cwd: /tmp/pip-install-ohfwxr4o/typed-ast/
Complete output (23 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.7
creating build/lib.linux-x86_64-3.7/typed_ast
copying typed_ast/ast3.py -> build/lib.linux-x86_64-3.7/typed_ast
copying typed_ast/conversions.py -> build/lib.linux-x86_64-3.7/typed_ast
copying typed_ast/ast27.py -> build/lib.linux-x86_64-3.7/typed_ast
copying typed_ast/__init__.py -> build/lib.linux-x86_64-3.7/typed_ast
package init file 'ast3/tests/__init__.py' not found (or not a regular file)
creating build/lib.linux-x86_64-3.7/typed_ast/tests
copying ast3/tests/test_basics.py -> build/lib.linux-x86_64-3.7/typed_ast/tests
running build_ext
building '_ast27' extension
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/ast27
creating build/temp.linux-x86_64-3.7/ast27/Parser
creating build/temp.linux-x86_64-3.7/ast27/Python
creating build/temp.linux-x86_64-3.7/ast27/Custom
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -DTHREAD_STACK_SIZE=0x100000 -fPIC -Iast27/Include -I/usr/local/include/python3.7m -c ast27/Parser/acceler.c -o build/temp.linux-x86_64-3.7/ast27/Parser/acceler.o
unable to execute 'gcc': No such file or directory
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ohfwxr4o/typed-ast/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ohfwxr4o/typed-ast/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-glxx7aqy/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.
The command '/bin/sh -c pip install -r requirements.txt --default-timeout=100 future' returned a non-zero code: 1```