I'm new to Docker and I'm trying to dockerize a Django app but when I run docker build -t sometag . I receive the following error:
#9 23.05 Preparing metadata (setup.py): started
#9 23.32 Preparing metadata (setup.py): finished with status 'error'
#9 23.33 error: subprocess-exited-with-error
#9 23.33
#9 23.33 × python setup.py egg_info did not run successfully.
#9 23.33 │ exit code: 1
#9 23.33 ╰─> [10 lines of output]
#9 23.33 ##### setup-python-3.10.8-linux-x86_64: ================================================
#9 23.33 ##### setup-python-3.10.8-linux-x86_64: Attempting build of _rl_accel
#9 23.33 ##### setup-python-3.10.8-linux-x86_64: extensions from 'src/rl_addons/rl_accel'
#9 23.33 ##### setup-python-3.10.8-linux-x86_64: ================================================
#9 23.33 ##### setup-python-3.10.8-linux-x86_64: ===================================================
#9 23.33 ##### setup-python-3.10.8-linux-x86_64: Attempting build of _renderPM
#9 23.33 ##### setup-python-3.10.8-linux-x86_64: extensions from 'src/rl_addons/renderPM'
#9 23.33 ##### setup-python-3.10.8-linux-x86_64: ===================================================
#9 23.33 ##### setup-python-3.10.8-linux-x86_64: will use package libart 2.3.21
#9 23.33 !!!!! cannot find ft2build.h
#9 23.33 [end of output]
#9 23.33
#9 23.33 note: This error originates from a subprocess, and is likely not a problem with pip.
#9 23.33 error: metadata-generation-failed
#9 23.33
#9 23.33 × Encountered error while generating package metadata.
#9 23.33 ╰─> See above for output.
#9 23.33
#9 23.33 note: This is an issue with the package mentioned above, not pip.
#9 23.33 hint: See above for details.
------
executor failed running [/bin/sh -c pip install -r requirements.txt]: exit code: 1
I'm not sure if it is related to ft2build.h.I'm I missing something on my dockerfile?
This is my requirements.txt:
arabic-reshaper==2.1.3
asn1crypto==1.5.1
attrs==20.3.0
azure-core==1.23.1
azure-storage-blob==12.11.0
certifi==2021.10.8
cffi==1.15.0
charset-normalizer==2.0.12
click==8.1.2
colorama==0.4.4
cryptography==36.0.2
cssselect2==0.5.0
distlib==0.3.5
Django==4.0.3
django-crispy-forms==1.14.0
django-storages==1.12.3
djangorestframework==3.14.0
filelock==3.8.0
future==0.18.2
html5lib==1.1
idna==3.3
isodate==0.6.1
jellyfish==0.9.0
lib50==3.0.4
lxml==4.8.0
markdown2==2.4.2
msrest==0.6.21
oauthlib==3.2.0
oscrypto==1.3.0
pexpect==4.8.0
Pillow==9.1.0
platformdirs==2.5.2
psycopg2-binary==2.9.3
ptyprocess==0.7.0
pycparser==2.21
pyHanko==0.12.1
pyhanko-certvalidator==0.19.5
PyPDF2==1.27.3
PyPDF3==1.0.6
python-bidi==0.4.2
pytz==2022.1
PyYAML==5.4.1
qrcode==7.3.1
reportlab==3.6.9
requests==2.27.1
requests-oauthlib==1.3.1
six==1.16.0
submit50==3.1.1
svglib==1.2.1
termcolor==1.1.0
tinycss2==1.1.1
tk==0.1.0
tqdm==4.64.0
typing_extensions==4.1.1
tzdata==2022.1
tzlocal==4.2
uritools==4.0.0
urllib3==1.26.9
virtualenv==20.16.3
webencodings==0.5.1
whitenoise==6.0.0
xhtml2pdf==0.2.7
Note: I had to remove the dockerfile as Stackoverflow wouldn't allow me to publish so much code but I'm running this RUN apk update \&& apk add --no-cache gcc musl-dev postgresql-dev python3-dev libffi-dev \&& pip install --upgrade pip
I'm not sure if it is related to ft2build.h.I'm I missing something on my dockerfile?
To solve the problem with the error ft2build.h. in the compile process, you need the freetype library installed
I assume you are using the last version of Alpine, and I can see you can install pip packages without problems.
As a result, the missing part should be the freetype-dev package to install.
RUN apk update \
&& apk add --no-cache gcc musl-dev postgresql-dev python3-dev libffi-dev freetype-dev\
Related
I am trying to build a docker image for a flask application, which requires pymssql to connect to the sql server. Have specified pymssql===2.2.5 in the requirements.txt file and trying to build the image.
I have tried docker build -t <image-name> .
Collecting pymssql==2.2.5
#9 23.25 Downloading pymssql-2.2.5.tar.gz (170 kB)
#9 23.27 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 170.1/170.1 KB 9.9 MB/s eta 0:00:00
#9 23.38 Installing build dependencies: started
#9 27.65 Installing build dependencies: finished with status 'done'
#9 27.65 Getting requirements to build wheel: started
#9 27.90 Getting requirements to build wheel: finished with status 'error'
#9 27.90 error: subprocess-exited-with-error
#9 27.90
#9 27.90 × Getting requirements to build wheel did not run successfully.
#9 27.90 │ exit code: 1
#9 27.90 ╰─> [6 lines of output]
#9 27.90 setup.py: platform.system() => Linux
#9 27.90 setup.py: platform.architecture() => ('64bit', '')
#9 27.90 setup.py: platform.libc_ver() => ('glibc', '2.31')
#9 27.90 setup.py: include_dirs => []
#9 27.90 setup.py: library_dirs => []
#9 27.90 setup.py: could not locate 'clock_gettime' function required by FreeTDS.
#9 27.90 [end of output]
#9 27.90
#9 27.90 note: This error originates from a subprocess, and is likely not a problem with pip.
#9 27.90 error: subprocess-exited-with-error
I am rather new to Docker and I am trying to build the following image on my macos Monterey:
ARG IMAGE_TAG=3.10.0-slim-bullseye
FROM python:${IMAGE_TAG}
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get autoremove -y \
&& apt-get install -y \
gcc g++ \
# Needed for pygrib on osx
# libeccodes-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN pip install --upgrade pip \
&& pip install pygrib==2.1.4 \
But it does not work unless I uncomment the libeccodes-dev line.
I installed eccodes as brew install eccodes and I am in a conda environment where I ran conda install -c conda-forge eccodes and also tried pip install pygrib, but nothing seems to work.
I keep getting the following error when trying to build, complaining about eccodes not being there:
=> ERROR [3/3] RUN pip install --upgrade pip && pip install pygrib==2.1.4 14.8s
------
> [3/3] RUN pip install --upgrade pip && pip install pygrib==2.1.4:
#6 1.093 Requirement already satisfied: pip in /usr/local/lib/python3.10/site-packages (21.2.4)
#6 1.484 Collecting pip
#6 1.549 Downloading pip-22.1.2-py3-none-any.whl (2.1 MB)
#6 1.890 Installing collected packages: pip
#6 1.890 Attempting uninstall: pip
#6 1.891 Found existing installation: pip 21.2.4
#6 1.966 Uninstalling pip-21.2.4:
#6 2.105 Successfully uninstalled pip-21.2.4
#6 2.713 Successfully installed pip-22.1.2
#6 2.713 WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
#6 3.024 Collecting pygrib==2.1.4
#6 3.081 Downloading pygrib-2.1.4.tar.gz (21.8 MB)
#6 6.127 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 21.8/21.8 MB 6.9 MB/s eta 0:00:00
#6 6.484 Installing build dependencies: started
#6 11.90 Installing build dependencies: finished with status 'done'
#6 11.90 Getting requirements to build wheel: started
#6 12.03 Getting requirements to build wheel: finished with status 'done'
#6 12.03 Preparing metadata (pyproject.toml): started
#6 12.14 Preparing metadata (pyproject.toml): finished with status 'done'
#6 12.28 Collecting numpy
#6 12.31 Using cached numpy-1.23.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (13.9 MB)
#6 12.39 Collecting pyproj
#6 12.40 Downloading pyproj-3.3.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (5.8 MB)
#6 13.66 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.8/5.8 MB 4.6 MB/s eta 0:00:00
#6 13.70 Collecting certifi
#6 13.95 Downloading certifi-2022.6.15-py3-none-any.whl (160 kB)
#6 13.97 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 160.2/160.2 kB 11.7 MB/s eta 0:00:00
#6 13.97 Building wheels for collected packages: pygrib
#6 13.98 Building wheel for pygrib (pyproject.toml): started
#6 14.68 Building wheel for pygrib (pyproject.toml): finished with status 'error'
#6 14.68 error: subprocess-exited-with-error
#6 14.68
#6 14.68 × Building wheel for pygrib (pyproject.toml) did not run successfully.
#6 14.68 │ exit code: 1
#6 14.68 ╰─> [29 lines of output]
#6 14.68 eccodes not found, build may fail...
#6 14.68 running bdist_wheel
#6 14.68 running build
#6 14.68 running build_py
#6 14.68 creating build
#6 14.68 creating build/lib.linux-aarch64-cpython-310
#6 14.68 creating build/lib.linux-aarch64-cpython-310/pygrib
#6 14.68 copying src/pygrib/__init__.py -> build/lib.linux-aarch64-cpython-310/pygrib
#6 14.68 running build_ext
#6 14.68 cythoning src/pygrib/_pygrib.pyx to src/pygrib/_pygrib.c
#6 14.68 /tmp/pip-build-env-c9rf_j3a/overlay/lib/python3.10/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /tmp/pip-install-ewf87o4j/pygrib_0cec9ea4e92e455fbd34ba265ffd15b2/src/pygrib/_pygrib.pyx
#6 14.68 tree = Parsing.p_module(s, pxd, full_module_name)
#6 14.68 building 'pygrib._pygrib' extension
#6 14.68 creating build/temp.linux-aarch64-cpython-310
#6 14.68 creating build/temp.linux-aarch64-cpython-310/src
#6 14.68 creating build/temp.linux-aarch64-cpython-310/src/pygrib
#6 14.68 gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/local/include/python3.10 -I/tmp/pip-build-env-c9rf_j3a/overlay/lib/python3.10/site-packages/numpy/core/include -c src/pygrib/_pygrib.c -o build/temp.linux-aarch64-cpython-310/src/pygrib/_pygrib.o
#6 14.68 In file included from /tmp/pip-build-env-c9rf_j3a/overlay/lib/python3.10/site-packages/numpy/core/include/numpy/ndarraytypes.h:1948,
#6 14.68 from /tmp/pip-build-env-c9rf_j3a/overlay/lib/python3.10/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
#6 14.68 from /tmp/pip-build-env-c9rf_j3a/overlay/lib/python3.10/site-packages/numpy/core/include/numpy/arrayobject.h:5,
#6 14.68 from src/pygrib/_pygrib.c:698:
#6 14.68 /tmp/pip-build-env-c9rf_j3a/overlay/lib/python3.10/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
#6 14.68 17 | #warning "Using deprecated NumPy API, disable it with " \
#6 14.68 | ^~~~~~~
#6 14.68 src/pygrib/_pygrib.c:708:10: fatal error: grib_api.h: No such file or directory
#6 14.68 708 | #include "grib_api.h"
#6 14.68 | ^~~~~~~~~~~~
#6 14.68 compilation terminated.
#6 14.68 error: command '/usr/bin/gcc' failed with exit code 1
#6 14.68 [end of output]
#6 14.68
#6 14.68 note: This error originates from a subprocess, and is likely not a problem with pip.
#6 14.68 ERROR: Failed building wheel for pygrib
#6 14.68 Failed to build pygrib
#6 14.68 ERROR: Could not build wheels for pygrib, which is required to install pyproject.toml-based projects
------
executor failed running [/bin/sh -c pip install --upgrade pip && pip install pygrib==2.1.4]: exit code: 1
However, if I pip install and import pygrib in the same conda environment (without Docker), it succeeds with no issues, meaning that eccodes is actually correctly installed.
Also, the image can be built successfully from any computer running Linux.
I am a bit confused by this behaviour, any idea on how to work around this would be very much appreciated.
Im trying to run the below Dockerfile using docker-compose.
I searched around but I couldnt find a solution on how to install cffi with python:3.9-alpine.
I also read this post which states that pip 21.2.4 or greater can be a possible solution but it didn't work out form me
https://www.pythonfixing.com/2021/09/fixed-why-i-getting-this-error-while.html
Docker file
FROM python:3.9-alpine
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
COPY ./requirements.txt .
RUN apk add --update --no-cache postgresql-client
RUN apk add --update --no-cache --virtual .tmp-build-deps \
gcc libc-dev linux-headers postgresql-dev
RUN pip3 install --upgrade pip && pip3 install -r /requirements.txt
RUN apk del .tmp-build-deps
RUN mkdir /app
WORKDIR /app
COPY . /app
RUN adduser -D user
USER user
This is the requirements.txt file.
asgiref==3.5.0
backports.zoneinfo==0.2.1
certifi==2021.10.8
cffi==1.15.0
cfgv==3.3.1
...
Error message:
process-exited-with-error
#9 47.99
#9 47.99 × Running setup.py install for cffi did not run successfully.
#9 47.99 │ exit code: 1
#9 47.99 ╰─> [58 lines of output]
#9 47.99 Package libffi was not found in the pkg-config search path.
#9 47.99 Perhaps you should add the directory containing `libffi.pc'
#9 47.99 to the PKG_CONFIG_PATH environment variable
#9 47.99 Package 'libffi', required by 'virtual:world', not found
#9 47.99 Package libffi was not found in the pkg-config search path.
#9 47.99 Perhaps you should add the directory containing `libffi.pc'
#9 47.99 to the PKG_CONFIG_PATH environment variable
#9 47.99 Package 'libffi', required by 'virtual:world', not found
#9 47.99 Package libffi was not found in the pkg-config search path.
#9 47.99 Perhaps you should add the directory containing `libffi.pc'
#9 47.99 to the PKG_CONFIG_PATH environment variable
#9 47.99 Package 'libffi', required by 'virtual:world', not found
#9 47.99 Package libffi was not found in the pkg-config search path.
#9 47.99 Perhaps you should add the directory containing `libffi.pc'
#9 47.99 to the PKG_CONFIG_PATH environment variable
#9 47.99 Package 'libffi', required by 'virtual:world', not found
#9 47.99 Package libffi was not found in the pkg-config search path.
#9 47.99 Perhaps you should add the directory containing `libffi.pc'
#9 47.99 to the PKG_CONFIG_PATH environment variable
#9 47.99 Package 'libffi', required by 'virtual:world', not found
#9 47.99 running install
#9 47.99 running build
#9 47.99 running build_py
#9 47.99 creating build
#9 47.99 creating build/lib.linux-aarch64-3.9
#9 47.99 creating build/lib.linux-aarch64-3.9/cffi
#9 47.99 copying cffi/__init__.py -> build/lib.linux-aarch64-3.9/cffi
#9 47.99 copying cffi/cffi_opcode.py -> build/lib.linux-aarch64-3.9/cffi
#9 47.99 copying cffi/commontypes.py -> build/lib.linux-aarch64-3.9/cffi
#9 47.99 copying cffi/vengine_gen.py -> build/lib.linux-aarch64-3.9/cffi
#9 47.99 copying cffi/vengine_cpy.py -> build/lib.linux-aarch64-3.9/cffi
#9 47.99 copying cffi/backend_ctypes.py -> build/lib.linux-aarch64-3.9/cffi
#9 47.99 copying cffi/api.py -> build/lib.linux-aarch64-3.9/cffi
#9 47.99 copying cffi/ffiplatform.py -> build/lib.linux-aarch64-3.9/cffi
#9 47.99 copying cffi/verifier.py -> build/lib.linux-aarch64-3.9/cffi
#9 47.99 copying cffi/error.py -> build/lib.linux-aarch64-3.9/cffi
#9 47.99 copying cffi/setuptools_ext.py -> build/lib.linux-aarch64-3.9/cffi
#9 47.99 copying cffi/lock.py -> build/lib.linux-aarch64-3.9/cffi
#9 47.99 copying cffi/recompiler.py -> build/lib.linux-aarch64-3.9/cffi
#9 47.99 copying cffi/pkgconfig.py -> build/lib.linux-aarch64-3.9/cffi
#9 47.99 copying cffi/cparser.py -> build/lib.linux-aarch64-3.9/cffi
#9 47.99 copying cffi/model.py -> build/lib.linux-aarch64-3.9/cffi
#9 47.99 copying cffi/_cffi_include.h -> build/lib.linux-aarch64-3.9/cffi
#9 47.99 copying cffi/parse_c_type.h -> build/lib.linux-aarch64-3.9/cffi
#9 47.99 copying cffi/_embedding.h -> build/lib.linux-aarch64-3.9/cffi
#9 47.99 copying cffi/_cffi_errors.h -> build/lib.linux-aarch64-3.9/cffi
#9 47.99 warning: build_py: byte-compiling is disabled, skipping.
#9 47.99
#9 47.99 running build_ext
#9 47.99 building '_cffi_backend' extension
#9 47.99 creating build/temp.linux-aarch64-3.9
#9 47.99 creating build/temp.linux-aarch64-3.9/c
#9 47.99 gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -DTHREAD_STACK_SIZE=0x100000 -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/usr/local/include/python3.9 -c c/_cffi_backend.c -o build/temp.linux-aarch64-3.9/c/_cffi_backend.o
#9 47.99 c/_cffi_backend.c:15:10: fatal error: ffi.h: No such file or directory
#9 47.99 15 | #include <ffi.h>
#9 47.99 | ^~~~~~~
#9 47.99 compilation terminated.
#9 47.99 error: command '/usr/bin/gcc' failed with exit code 1
#9 47.99 [end of output]
#9 47.99
#9 47.99 note: This error originates from a subprocess, and is likely not a problem with pip.
#9 47.99 error: legacy-install-failure
#9 47.99
#9 47.99 × Encountered error while trying to install package.
#9 47.99 ╰─> cffi
#9 47.99
#9 47.99 note: This is an issue with the package mentioned above, not pip.
#9 47.99 hint: See above for output from the failure.
The libffi library is missing.
Add it to your dockerfile:
RUN apk add libffi-dev
#Klaus D.'s comment helped a lot.
I updated Dockerfile:
RUN apk add --update --no-cache --virtual .tmp-build-deps \
gcc libc-dev linux-headers postgresql-dev \
&& apk add libffi-dev
If you are installing your Python packages running on openjdk:11.0.11-jre-slim-buster Docker container, and you encounter this problem. Add the commands below to build your docker image.
RUN apt-get install -y build-essential libssl-dev libffi-dev python-dev
RUN python3 -m pip install --upgrade pip
COPY ./requirements.txt /
I'm having problem building Docker image from aws-mwaa-local-runner repository (using their release v2.0.2). Apparently it has problem with Flask-OpenID 1.2.5 (see output below) but I'm lost as to how to resolve it.
For the record, I tried this with Docker for Windows version 20.10.12, Ubuntu distro running with Windows Subsystem for Linux version 2, Kernel version 5.10.16.
=> [ 7/13] RUN chmod u+x /bootstrap.sh && /bootstrap.sh
...
#11 67.25 Collecting Flask-OpenID<2,>=1.2.5
#11 67.30 Downloading Flask-OpenID-1.2.5.tar.gz (43 kB)
#11 67.32 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 43.4/43.4 KB 3.2 MB/s eta 0:00:00
#11 67.33 Preparing metadata (setup.py): started
#11 67.51 Preparing metadata (setup.py): finished with status 'error'
#11 67.52 error: subprocess-exited-with-error
#11 67.52
#11 67.52 × python setup.py egg_info did not run successfully.
#11 67.52 │ exit code: 1
#11 67.52 ╰─> [1 lines of output]
#11 67.52 error in Flask-OpenID setup command: use_2to3 is invalid.
#11 67.52 [end of output]
#11 67.52
#11 67.52 note: This error originates from a subprocess, and is likely not a problem with pip.
#11 67.52 error: metadata-generation-failed
#11 67.52
#11 67.52 × Encountered error while generating package metadata.
#11 67.52 ╰─> See above for output.
#11 67.52
#11 67.52 note: This is an issue with the package mentioned above, not pip.
#11 67.52 hint: See above for details.
------
executor failed running [/bin/sh -c chmod u+x /bootstrap.sh && /bootstrap.sh]: exit code: 1
For the record, I was able to solve this issue by changing Flask-OpenID version in /docker/config/requirements.txt and /docker/config/constraints.txt from 1.2.5 to 1.3.0 and finished building the image successfully.
I'm trying to build a Docker image for an AWS Batch job, but a new requirement (the Python package statsmodels) is breaking my build process.
requirements.txt lines:
pandas
numpy
statsmodels
Complete Dockerfile:
FROM python:3
COPY requirements.txt /home/
COPY .env /home/
COPY src home/src
COPY process.py /home/
WORKDIR /home/
ENV TZ=America/New_York
RUN /usr/local/bin/python -m pip install --upgrade pip
RUN pip install -r ./requirements.txt
ENV PYTHONPATH='.'
Error log excerpts:
#12 271.7 INFO: pip is looking at multiple versions of <Python from Requires-Python> to determine which version is compatible with other requirements. This could take a while.
#12 288.4 INFO: pip is looking at multiple versions of us to determine which version is compatible with other requirements. This could take a while.
#12 288.4 Collecting us
#12 288.4 Downloading us-2.0.1.tar.gz (13 kB)
#12 288.8 Downloading us-2.0.0.tar.gz (13 kB)
#12 289.3 Downloading us-1.0.0.tar.gz (13 kB)
#12 289.8 Downloading us-0.9.1.tar.gz (13 kB)
#12 290.2 Downloading us-0.9.0.tar.gz (13 kB)
#12 290.6 Downloading us-0.8.0.tar.gz (12 kB)
#12 291.2 Downloading us-0.7.1.tar.gz (12 kB)
#12 291.5 INFO: pip is looking at multiple versions of <Python from Requires-Python> to determine which version is compatible with other requirements. This could take a while.
#12 291.5 INFO: pip is looking at multiple versions of us to determine which version is compatible with other requirements. This could take a while.
#12 291.6 Downloading us-0.7.tar.gz (11 kB)
#12 291.9 Downloading us-0.6.tar.gz (9.9 kB)
#12 292.3 Downloading us-0.5.tar.gz (9.3 kB)
#12 292.7 Downloading us-0.4.tar.gz (9.3 kB)
#12 293.0 Downloading us-0.3.tar.gz (7.5 kB)
#12 293.4 INFO: This is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime. If you want to abort this run, you can press Ctrl + C to do so. To improve how pip performs, tell us what happened here: https://pip.pypa.io/surveys/backtracking
#12 293.4 INFO: This is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime. If you want to abort this run, you can press Ctrl + C to do so. To improve how pip performs, tell us what happened here: https://pip.pypa.io/surveys/backtracking
#12 293.4 Downloading us-0.2.tar.gz (6.9 kB)
#12 294.0 Downloading us-0.1.tar.gz (6.3 kB)
#12 294.4 INFO: pip is looking at multiple versions of statsmodels to determine which version is compatible with other requirements. This could take a while.
#12 294.9 Collecting statsmodels
#12 294.9 Downloading statsmodels-0.12.0.tar.gz (17.5 MB)
#12 297.5 Installing build dependencies: started
#12 309.5 Installing build dependencies: finished with status 'done'
#12 309.5 Getting requirements to build wheel: started
#12 392.2 Getting requirements to build wheel: still running...
#12 400.0 Getting requirements to build wheel: finished with status 'done'
#12 400.1 Preparing wheel metadata: started
#12 401.3 Preparing wheel metadata: finished with status 'done'
#12 401.9 Downloading statsmodels-0.11.1.tar.gz (15.4 MB)
#12 404.2 Installing build dependencies: started
#12 415.7 Installing build dependencies: finished with status 'done'
#12 415.7 Getting requirements to build wheel: started
#12 480.8 Getting requirements to build wheel: still running...
#12 481.5 Getting requirements to build wheel: finished with status 'done'
#12 481.5 Preparing wheel metadata: started
#12 482.6 Preparing wheel metadata: finished with status 'done'
#12 483.1 Downloading statsmodels-0.11.0.tar.gz (15.4 MB)
#12 485.5 Installing build dependencies: started
#12 488.6 Installing build dependencies: finished with status 'error'
#12 488.6 ERROR: Command errored out with exit status 1:
#12 488.6 command: /usr/local/bin/python /usr/local/lib/python3.9/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-_0xxe4fy/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel 'cython>=0.29.14' 'numpy==1.14.5; python_version=='"'"'3.5'"'"'' 'numpy==1.14.5; python_version=='"'"'3.6'"'"'' 'numpy==1.14.5; python_version>='"'"'3.7'"'"'' 'numpy==1.17.5; python_version>='"'"'3.8'"'"'' 'scipy>=1.0'
#12 488.6 cwd: None
#12 488.6 Complete output (13 lines):
#12 488.6 Ignoring numpy: markers 'python_version == "3.5"' don't match your environment
#12 488.6 Ignoring numpy: markers 'python_version == "3.6"' don't match your environment
#12 488.6 ERROR: Cannot install numpy==1.14.5 and numpy==1.17.5 because these package versions have conflicting dependencies.
#12 488.6
#12 488.6 The conflict is caused by:
#12 488.6 The user requested numpy==1.14.5
#12 488.6 The user requested numpy==1.17.5
#12 488.6
#12 488.6 To fix this you could try to:
#12 488.6 1. loosen the range of package versions you've specified
#12 488.6 2. remove package versions to allow pip attempt to solve the dependency conflict
#12 488.6
#12 488.6 ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies
#12 488.6 ----------------------------------------
#12 488.6 ERROR: Command errored out with exit status 1: /usr/local/bin/python /usr/local/lib/python3.9/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-_0xxe4fy/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel 'cython>=0.29.14' 'numpy==1.14.5; python_version=='"'"'3.5'"'"'' 'numpy==1.14.5; python_version=='"'"'3.6'"'"'' 'numpy==1.14.5; python_version>='"'"'3.7'"'"'' 'numpy==1.17.5; python_version>='"'"'3.8'"'"'' 'scipy>=1.0' Check the logs for full command output.
------
failed to solve with frontend dockerfile.v0: failed to build LLB: executor failed running [/bin/sh -c pip install -r ./requirements.txt]: runc did not terminate sucessfully
Updated Dockerfile per comments:
FROM debian:10-slim
# install Python, pip, and misc build needs
RUN apt-get update \
&& apt-get install --no-install-recommends -y \
build-essential \
python3-dev \
python3-pip \
python3-setuptools \
&& apt-get clean
# bring in program logic
COPY .env /root/.env # this may need to go into /root/.env (or a custom user)
COPY src /app/
COPY processer.py submit-processer.py /app/
COPY requirements.txt /app/
# install Python dependencies
RUN pip3 install --no-cache-dir -r /app/requirements.txt
# set env vars
ENV TZ=America/New_York
# running process logic
WORKDIR /app
ENTRYPOINT ["python3", "processer.py"]
Error log of updated process:
[+] Building 0.7s (7/12)
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 979B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/debian:10-slim 0.6s
=> [internal] load build context 0.0s
=> => transferring context: 15.91kB 0.0s
=> CANCELED [1/8] FROM docker.io/library/debian:10-slim#sha256:062bbd9a1 0.0s
=> => resolve docker.io/library/debian:10-slim#sha256:062bbd9a1a58c9c5b8 0.0s
=> CACHED [2/8] RUN apt-get update && apt-get install --no-install-r 0.0s
=> ERROR [3/8] COPY .env /root/.env # this may need to go into /root/.e 0.0s
------
> [3/8] COPY .env /root/.env # this may need to go into /root/.env (or a custom user):
------
failed to solve with frontend dockerfile.v0: failed to build LLB: failed to compute cache key: "/#" not found: not found
It's not entirely clear why from your Dockerfile (I'm surprised the tag 3 isn't sufficient to just pick the latest stable of 3.9.1-buster), but pip is trying to resolve dependencies for several versions of Python (implying there are several installed in the base container)
#12 488.6 ERROR: Command errored out with exit status 1: /usr/local/bin/python /usr/local/lib/python3.9/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-_0xxe4fy/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel 'cython>=0.29.14' 'numpy==1.14.5; python_version=='"'"'3.5'"'"'' 'numpy==1.14.5; python_version=='"'"'3.6'"'"'' 'numpy==1.14.5; python_version>='"'"'3.7'"'"'' 'numpy==1.17.5; python_version>='"'"'3.8'"'"'' 'scipy>=1.0' Check the logs for full command output.
Specifying a minor version may clear this up.
If you don't have a particular version need, 3.8-slim-buster (Debian 10 with Python 3.8 .. actually 3.8.9 for now though this may change with bug fixes to that version) may be a practical choice and fix this for you!
from python:3.8-slim-buster
...
If this does not fix the error, then it's likely your 3 tag is just fine and instead extremely-likely that your .env is problematic (presumably it's a Python virtual environment you are trying to preserve).
Regenerate the venv within the context of your container with a new RUN block rather than COPY-ing what your host system has.
After the comments, I think it's worth trying a different Dockerfile which is much more what I would use with at least the following changes
base directly off Debian 10 (you may find another container is more efficient/smaller/whatever, but it's extremely likely this works out of the box)
install Python 3 yourself
don't use /home/ as a base
FROM debian:10-slim
# install Python, pip, and misc build needs
RUN apt-get update \
&& apt-get install --no-install-recommends -y \
build-essential \
python3-dev \
python3-pip \
python3-setuptools \
&& apt-get clean
# bring in program logic
COPY .env /app/ # this may need to go into /root/.env (or a custom user)
COPY src /app/
COPY process.py /app/
COPY requirements.txt /app/
# install Python dependencies
RUN pip3 install --no-cache-dir -r /app/requirements.txt
# set env vars
ENV TZ=America/New_York
# running process logic
WORKDIR /app
ENTRYPOINT ["python3", "process.py"]
If this works
using /home may be problematic (rather than /home/someuser/...)
there could be something weird with the upstream python base container (I have never personally used it, though that would also be surprising)
If this does not work
you may not be working in the directory you think you are (ie. copying the current directory in, another similar-looking directory, etc.)
your src may have something bizarre in it
statsmodels may be broken (it's versioned 0.12, so that's not totally unreasonable)