Oracledb dicker Modus fehlschlagenPython

Python-Programme
Anonymous
 Oracledb dicker Modus fehlschlagen

Post by Anonymous »

Ich habe eine Fastapi-App und seine Dockerfile sieht so aus: < /p>

Code: Select all

FROM python:3.12-slim
# Oralce dep
WORKDIR /opt/oracle
RUN apt-get update && apt-get install -y iputils-ping wget unzip libaio1
RUN wget https://download.oracle.com/otn_software/linux/instantclient/instantclient-basiclite-linuxx64.zip && \
unzip instantclient-basiclite-linuxx64.zip && rm -f instantclient-basiclite-linuxx64.zip && \
cd /opt/oracle/instantclient* && rm -f *jdbc* *occi* *mysql* *README *jar uidrvci genezi adrci && \
echo /opt/oracle/instantclient* > /etc/ld.so.conf.d/oracle-instantclient.conf && ldconfig
RUN python -m pip install oracledb
# FastAPI
WORKDIR /code
COPY ./requirements.txt /code/requirements.txt
COPY ./app /code/app
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
RUN mkdir /code/logs
CMD ["python3", "./app/main.py"]
HEALTHCHECK --interval=60s --timeout=5s --retries=5 CMD wget --no-verbose -O /dev/null http://127.0.0.1:8080/latest/health || exit 1
< /code>
Und es funktionierte wie erwartet (vor einigen Monaten)

wie erwartet, aber jetzt habe ich versucht, es erneut zu bauen und Fehler zu erhalten, dass Libaio1 nicht lokalisiert werden kann#7 1.773 Reading package lists...
#7 2.338 Reading package lists...
#7 2.892 Building dependency tree...
#7 3.031 Reading state information...
#7 3.050 E: Unable to locate package libaio1
#7 ERROR: process "/bin/sh -c apt-get update && apt-get install -y iputils-ping wget unzip libaio1" did not complete successfully: exit code: 100
< /code>
Ich habe es also in libaio1t64

geändert, das sich um das Build-Problem gekümmert hat, aber jetzt habe ich ein Problem, wenn Docker versucht, zu laufen:File "/code/app/modules/database/databaseModel.py", line 7, in 
oracledb.init_oracle_client()
File "src/oracledb/impl/thick/utils.pyx", line 527, in oracledb.thick_impl.init_oracle_client
File "src/oracledb/impl/thick/utils.pyx", line 562, in oracledb.thick_impl.init_oracle_client
File "src/oracledb/impl/thick/utils.pyx", line 474, in oracledb.thick_impl._raise_from_info
oracledb.exceptions.DatabaseError: DPI-1047: Cannot locate a 64-bit Oracle Client library: "libaio.so.1: cannot open shared object file: No such file or directory". See https://python-oracledb.readthedocs.io/en/latest/user_guide/initialization.html for help
Help: https://python-oracledb.readthedocs.io/en/latest/user_guide/troubleshooting.html#dpi-1047
Weiß jemand, wie man dieses Problem behebt?

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post