from alpine:latest
RUN apk add --no-cache python3-dev \&& pip3 install --upgrade pipWORKDIR /backend
COPY . /backendRUN pip --no-cache-dir install -r requirements.txt
EXPOSE 5000
ENTRYPOINT ['python3']
CMD ['app.py']
I have a simple Dockerfile that looks like above.
When I do docker build -t backend:latest .
, it gives me
ERROR: Command errored out with exit status 1: /usr/bin/python3.7 /usr/lib/python3.7/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-wr55ljb4/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.8.0' wheel 'cffi>=1.1; python_implementation != '"'"'PyPy'"'"'' Check the logs for full command output.
The command '/bin/sh -c pip --no-cache-dir install -r requirements.txt' returned a non-zero code: 1
Seems like my pip is not working properly. Any thoughts?
error log
Step 5/8 : RUN pip --no-cache-dir install -r requirements.txt---> Running in 22ceccf0fd82
Collecting asn1crypto==0.24.0 (from -r requirements.txt (line 1))Downloading https://files.pythonhosted.org/packages/ea/cd/35485615f45f30a510576f1a56d1e0a7ad7bd8ab5ed7cdc600ef7cd06222/asn1crypto-0.24.0-py2.py3-none-any.whl (101kB)
Collecting bcrypt==3.1.7 (from -r requirements.txt (line 2))Downloading https://files.pythonhosted.org/packages/fa/aa/025a3ab62469b5167bc397837c9ffc486c42a97ef12ceaa6699d8f5a5416/bcrypt-3.1.7.tar.gz (42kB)Installing build dependencies: startedInstalling build dependencies: finished with status 'error'ERROR: Command errored out with exit status 1:command: /usr/local/bin/python /usr/local/lib/python3.6/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-kjhqh8sc/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.8.0' wheel 'cffi>=1.1; python_implementation != '"'"'PyPy'"'"''cwd: NoneComplete output (169 lines):Collecting setuptools>=40.8.0Downloading https://files.pythonhosted.org/packages/75/b3/0a106dfaf7f48aef638da80b32608617cc8de4b24a22c8cd3759c32e5d30/setuptools-41.1.0-py2.py3-none-any.whl (576kB)Collecting wheelDownloading https://files.pythonhosted.org/packages/bb/10/44230dd6bf3563b8f227dbf344c908d412ad2ff48066476672f3a72e174e/wheel-0.33.4-py2.py3-none-any.whlCollecting cffi>=1.1Downloading https://files.pythonhosted.org/packages/93/1a/ab8c62b5838722f29f3daffcc8d4bd61844aa9b5f437341cc890ceee483b/cffi-1.12.3.tar.gz (456kB)Collecting pycparser (from cffi>=1.1)Downloading https://files.pythonhosted.org/packages/68/9e/49196946aee219aead1290e00d1e7fdeab8567783e83e1b9ab5585e6206a/pycparser-2.19.tar.gz (158kB)Building wheels for collected packages: cffi, pycparserBuilding wheel for cffi (setup.py): startedBuilding wheel for cffi (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-68ehjxmi/cffi/setup.py'"'"'; __file__='"'"'/tmp/pip-install-68ehjxmi/cffi/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-hdxzm2ih --python-tag cp36cwd: /tmp/pip-install-68ehjxmi/cffi/Complete output (68 lines):Package libffi was not found in the pkg-config search path.Perhaps you should add the directory containing `libffi.pc'to the PKG_CONFIG_PATH environment variablePackage 'libffi', required by 'virtual:world', not foundPackage libffi was not found in the pkg-config search path.Perhaps you should add the directory containing `libffi.pc'to the PKG_CONFIG_PATH environment variablePackage 'libffi', required by 'virtual:world', not foundPackage libffi was not found in the pkg-config search path.Perhaps you should add the directory containing `libffi.pc'to the PKG_CONFIG_PATH environment variablePackage 'libffi', required by 'virtual:world', not foundPackage libffi was not found in the pkg-config search path.Perhaps you should add the directory containing `libffi.pc'to the PKG_CONFIG_PATH environment variablePackage 'libffi', required by 'virtual:world', not foundPackage libffi was not found in the pkg-config search path.Perhaps you should add the directory containing `libffi.pc'to the PKG_CONFIG_PATH environment variablePackage 'libffi', required by 'virtual:world', not foundunable to execute 'gcc': No such file or directoryunable to execute 'gcc': No such file or directoryNo working compiler found, or bogus compiler options passed tothe compiler from Python's standard "distutils" module. Seethe error messages above. Likely, the problem is not relatedto CFFI but generic to the setup.py of any Python package thattries to compile C code. (Hints: on OS/X 10.8, for errors about-mno-fused-madd see http://stackoverflow.com/questions/22313407/Otherwise, see https://wiki.python.org/moin/CompLangPython orthe IRC channel #python on irc.freenode.net.)Trying to continue anyway. If you are trying to install CFFI froma build done in a different context, you can ignore this warning.running bdist_wheelrunning buildrunning build_pycreating buildcreating build/lib.linux-x86_64-3.6creating build/lib.linux-x86_64-3.6/cfficopying cffi/cparser.py -> build/lib.linux-x86_64-3.6/cfficopying cffi/cffi_opcode.py -> build/lib.linux-x86_64-3.6/cfficopying cffi/pkgconfig.py -> build/lib.linux-x86_64-3.6/cfficopying cffi/lock.py -> build/lib.linux-x86_64-3.6/cfficopying cffi/vengine_cpy.py -> build/lib.linux-x86_64-3.6/cfficopying cffi/__init__.py -> build/lib.linux-x86_64-3.6/cfficopying cffi/vengine_gen.py -> build/lib.linux-x86_64-3.6/cfficopying cffi/verifier.py -> build/lib.linux-x86_64-3.6/cfficopying cffi/setuptools_ext.py -> build/lib.linux-x86_64-3.6/cfficopying cffi/commontypes.py -> build/lib.linux-x86_64-3.6/cfficopying cffi/recompiler.py -> build/lib.linux-x86_64-3.6/cfficopying cffi/model.py -> build/lib.linux-x86_64-3.6/cfficopying cffi/backend_ctypes.py -> build/lib.linux-x86_64-3.6/cfficopying cffi/api.py -> build/lib.linux-x86_64-3.6/cfficopying cffi/error.py -> build/lib.linux-x86_64-3.6/cfficopying cffi/ffiplatform.py -> build/lib.linux-x86_64-3.6/cfficopying cffi/_cffi_include.h -> build/lib.linux-x86_64-3.6/cfficopying cffi/parse_c_type.h -> build/lib.linux-x86_64-3.6/cfficopying cffi/_embedding.h -> build/lib.linux-x86_64-3.6/cfficopying cffi/_cffi_errors.h -> build/lib.linux-x86_64-3.6/cffirunning build_extbuilding '_cffi_backend' extensioncreating build/temp.linux-x86_64-3.6creating build/temp.linux-x86_64-3.6/cgcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -DTHREAD_STACK_SIZE=0x100000 -fPIC -I/usr/include/ffi -I/usr/include/libffi -I/usr/local/include/python3.6m -c c/_cffi_backend.c -o build/temp.linux-x86_64-3.6/c/_cffi_backend.ounable to execute 'gcc': No such file or directoryerror: command 'gcc' failed with exit status 1----------------------------------------ERROR: Failed building wheel for cffiRunning setup.py clean for cffiBuilding wheel for pycparser (setup.py): startedBuilding wheel for pycparser (setup.py): finished with status 'done'Created wheel for pycparser: filename=pycparser-2.19-py2.py3-none-any.whl size=111031 sha256=7214a0d655238f2c9991c7a92ece87d949521239504b9dcc5b2e8ac2f438679aStored in directory: /root/.cache/pip/wheels/f2/9a/90/de94f8556265ddc9d9c8b271b0f63e57b26fb1d67a45564511Successfully built pycparserFailed to build cffiInstalling collected packages: setuptools, wheel, pycparser, cffiRunning setup.py install for cffi: startedRunning setup.py install for cffi: 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-68ehjxmi/cffi/setup.py'"'"'; __file__='"'"'/tmp/pip-install-68ehjxmi/cffi/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-oq4j1nik/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-kjhqh8sc/overlay --compilecwd: /tmp/pip-install-68ehjxmi/cffi/Complete output (68 lines):Package libffi was not found in the pkg-config search path.Perhaps you should add the directory containing `libffi.pc'to the PKG_CONFIG_PATH environment variablePackage 'libffi', required by 'virtual:world', not foundPackage libffi was not found in the pkg-config search path.Perhaps you should add the directory containing `libffi.pc'to the PKG_CONFIG_PATH environment variablePackage 'libffi', required by 'virtual:world', not foundPackage libffi was not found in the pkg-config search path.Perhaps you should add the directory containing `libffi.pc'to the PKG_CONFIG_PATH environment variablePackage 'libffi', required by 'virtual:world', not foundPackage libffi was not found in the pkg-config search path.Perhaps you should add the directory containing `libffi.pc'to the PKG_CONFIG_PATH environment variablePackage 'libffi', required by 'virtual:world', not foundPackage libffi was not found in the pkg-config search path.Perhaps you should add the directory containing `libffi.pc'to the PKG_CONFIG_PATH environment variablePackage 'libffi', required by 'virtual:world', not foundunable to execute 'gcc': No such file or directoryunable to execute 'gcc': No such file or directoryNo working compiler found, or bogus compiler options passed tothe compiler from Python's standard "distutils" module. Seethe error messages above. Likely, the problem is not relatedto CFFI but generic to the setup.py of any Python package thattries to compile C code. (Hints: on OS/X 10.8, for errors about-mno-fused-madd see http://stackoverflow.com/questions/22313407/Otherwise, see https://wiki.python.org/moin/CompLangPython orthe IRC channel #python on irc.freenode.net.)Trying to continue anyway. If you are trying to install CFFI froma build done in a different context, you can ignore this warning.running installrunning buildrunning build_pycreating buildcreating build/lib.linux-x86_64-3.6creating build/lib.linux-x86_64-3.6/cfficopying cffi/cparser.py -> build/lib.linux-x86_64-3.6/cfficopying cffi/cffi_opcode.py -> build/lib.linux-x86_64-3.6/cfficopying cffi/pkgconfig.py -> build/lib.linux-x86_64-3.6/cfficopying cffi/lock.py -> build/lib.linux-x86_64-3.6/cfficopying cffi/vengine_cpy.py -> build/lib.linux-x86_64-3.6/cfficopying cffi/__init__.py -> build/lib.linux-x86_64-3.6/cfficopying cffi/vengine_gen.py -> build/lib.linux-x86_64-3.6/cfficopying cffi/verifier.py -> build/lib.linux-x86_64-3.6/cfficopying cffi/setuptools_ext.py -> build/lib.linux-x86_64-3.6/cfficopying cffi/commontypes.py -> build/lib.linux-x86_64-3.6/cfficopying cffi/recompiler.py -> build/lib.linux-x86_64-3.6/cfficopying cffi/model.py -> build/lib.linux-x86_64-3.6/cfficopying cffi/backend_ctypes.py -> build/lib.linux-x86_64-3.6/cfficopying cffi/api.py -> build/lib.linux-x86_64-3.6/cfficopying cffi/error.py -> build/lib.linux-x86_64-3.6/cfficopying cffi/ffiplatform.py -> build/lib.linux-x86_64-3.6/cfficopying cffi/_cffi_include.h -> build/lib.linux-x86_64-3.6/cfficopying cffi/parse_c_type.h -> build/lib.linux-x86_64-3.6/cfficopying cffi/_embedding.h -> build/lib.linux-x86_64-3.6/cfficopying cffi/_cffi_errors.h -> build/lib.linux-x86_64-3.6/cffirunning build_extbuilding '_cffi_backend' extensioncreating build/temp.linux-x86_64-3.6creating build/temp.linux-x86_64-3.6/cgcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -DTHREAD_STACK_SIZE=0x100000 -fPIC -I/usr/include/ffi -I/usr/include/libffi -I/usr/local/include/python3.6m -c c/_cffi_backend.c -o build/temp.linux-x86_64-3.6/c/_cffi_backend.ounable to execute 'gcc': No such file or directoryerror: 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-68ehjxmi/cffi/setup.py'"'"'; __file__='"'"'/tmp/pip-install-68ehjxmi/cffi/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-oq4j1nik/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-kjhqh8sc/overlay --compile Check the logs for full command output.----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/bin/python /usr/local/lib/python3.6/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-kjhqh8sc/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.8.0' wheel 'cffi>=1.1; python_implementation != '"'"'PyPy'"'"'' Check the logs for full command output.