Compile error when running "pip install -r requirements.txt"
I'm trying to build an image using the following Dockerfile and receiving a gcc compile error. Are there additional requirements beyond what's specified? Also, in following the readme for Replicator, it says:
- skopeo
- Python modules listed in requirements.txt
pip install -r requirements.txt
I've tried both "pip" and "pip3" with the same results, and different python images. Any suggestions are approached.
Dockerfile:
FROM python:3.7.7-alpine3.11
RUN apk add --no-cache \
skopeo \
git \
gcc
WORKDIR /python/src/iron-bank/replicator
RUN git clone https://repo1.dsop.io/dsop/iron-bank/replicator/replicator.git .
RUN pip3 install -r requirements.txt
when executing the docker build command, it errors out on the "pip3 install" with:
... earlier steps ommitted
Step 4/5 : RUN git clone https://repo1.dsop.io/dsop/iron-bank/replicator/replicator.git .
---> Using cache
---> 8b416d086eae
Step 5/5 : RUN pip3 install -r requirements.txt
---> Running in a63b16454ed2
Collecting astroid==2.3.3
Downloading astroid-2.3.3-py3-none-any.whl (205 kB)
... various requirements omitted ...
Collecting zipp==2.2.0
Downloading zipp-2.2.0-py36-none-any.whl (4.6 kB)
Building wheels for collected packages: coverage, lazy-object-proxy, MarkupSafe, typed-ast, wrapt
Building wheel for coverage (setup.py): started
Building wheel for coverage (setup.py): finished with status 'done'
Created wheel for coverage: filename=coverage-5.0.3-py3-none-any.whl size=195289 sha256=568834d19394f7b3afbc34e8776d8c7bcb834bb05b502cbf8c0f98ea5fbc2422
Stored in directory: /root/.cache/pip/wheels/9a/28/2e/363fdd99aaeb9b0d0a6ade93b69ecaf0e5f5a0a2b52133a7e7
Building wheel for lazy-object-proxy (PEP 517): started
Building wheel for lazy-object-proxy (PEP 517): finished with status 'done'
Created wheel for lazy-object-proxy: filename=lazy_object_proxy-1.4.3-cp37-cp37m-linux_x86_64.whl size=10000 sha256=0a939fa086b8a1bb47be1a1bfa4808e0911623a85502b8d1b15eaf0becc94de1
Stored in directory: /root/.cache/pip/wheels/23/d3/52/e98c2f4a043585615fd6ac4da3d5f155507377d6d7283f8256
Building wheel for MarkupSafe (setup.py): started
Building wheel for MarkupSafe (setup.py): finished with status 'done'
Created wheel for MarkupSafe: filename=MarkupSafe-1.1.1-py3-none-any.whl size=12629 sha256=5cf6f6763075205e8013ec8b0440fb7e3e6904f7609583de993c0a4dc05df977
Stored in directory: /root/.cache/pip/wheels/b9/d9/ae/63bf9056b0a22b13ade9f6b9e08187c1bb71c47ef21a8c9924
Building wheel for typed-ast (setup.py): started
Building wheel for typed-ast (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-ttfhixdq/typed-ast/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ttfhixdq/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-1rd339iq
cwd: /tmp/pip-install-ttfhixdq/typed-ast/
Complete output (28 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/__init__.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
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
In file included from ast27/Include/pgenheaders.h:8,
from ast27/Parser/acceler.c:13:
/usr/local/include/python3.7m/Python.h:11:10: fatal error: limits.h: No such file or directory
11 | #include <limits.h>
| ^~~~~~~~~~
compilation terminated.
error: command 'gcc' failed with exit status 1