I'm trying to create a container for my python project that uses mariaDB. Here there are dockerfile's lines related to the problem:
FROM python:3.10.6-slim-buster
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && \
apt-get install -yq apt-utils && \
apt-get install -yq procps && \
apt-get install -yq nano && \
apt-get install -yq libmariadb3 libmariadb-dev
RUN rm -rf /var/lib/apt/lists/*
RUN pip install --no-cache-dir -r requirements.txt
In my requirements.txt I have:
mariadb==1.1.4
When I run the docker build it returns me this error:
Collecting mariadb==1.1.4
Downloading mariadb-1.1.4.zip (97 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 97.4/97.4 kB 10.8 MB/s eta 0:00:00
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'error'
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [8 lines of output]
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/tmp/pip-install-2uzbllpk/mariadb_4588dbf4d5fc48b989ebd2605c2d7d1c/setup.py", line 27, in <module>
cfg = get_config(options)
File "/tmp/pip-install-2uzbllpk/mariadb_4588dbf4d5fc48b989ebd2605c2d7d1c/mariadb_posix.py", line 64, in get_config
print('MariaDB Connector/Python requires MariaDB Connector/C '
TypeError: not enough arguments for format string
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
As you can see, I installed the required packages for the connector via apt-get, the installation works without error, but I am still having this problem.
Do you have any idea?
Thank you.