OpenInformix / IfxPy

Informix native Python driver for scalable enterprise and IoT solutions.
Other
46 stars 22 forks source link

I have an issue with CSDK and docker #76

Closed OmidRasouli closed 1 year ago

OmidRasouli commented 1 year ago

Hi, I wanted to dockerize my project. when I wanted to run docker I got an error in the line below: RUN /informix_client_sdk/installclientsdk -i silent -DLICENSE_ACCEPTED=TRUE -DLEGACY=TRUE I have the CSDK in client_sdk directory in the same root of the Dockerfile. This is the error:

RUN /informix_client_sdk/installclientsdk -i silent -DLICENSE_ACCEPTED=TRUE -DLEGACY=TRUE:
------
failed to solve: process "/bin/sh -c /informix_client_sdk/installclientsdk -i silent -DLICENSE_ACCEPTED=TRUE -DLEGACY=TRUE" did not complete successfully: exit code: 244

This is my Dockerfile:

FROM python:3.8-slim

RUN apt-get update \
    && apt-get install -y build-essential libldap2-dev libsasl2-dev

ADD ./client_sdk /informix_client_sdk
RUN /informix_client_sdk/installclientsdk -i silent -DLICENSE_ACCEPTED=TRUE -DLEGACY=TRUE

ENV INFORMIXDIR=/opt/IBM/Informix_Client-SDK
ENV LD_LIBRARY_PATH=${INFORMIXDIR}/lib:${INFORMIXDIR}/lib/esql:${INFORMIXDIR}/lib/cli
ENV PATH=$PATH:/opt/IBM/Informix_Client-SDK/bin
ENV CSDK_HOME=${INFORMIXDIR}

RUN pip install --upgrade pip

COPY ./requirements.txt .
RUN pip install -r requirements.txt

EXPOSE 8003

COPY . /app
WORKDIR /app

COPY ./entrypoint.sh .
ENTRYPOINT [ "sh", "/app/entrypoint.sh" ]
jsagrera commented 1 year ago

The 244 error during an install usually means there are some requirements missing. If you do a manual install you should see a message like:

One or more prerequisite system libraries are not installed on your computer. 
Install libdl.so.2, libcrypt.so.1, libpam.so.0, libstdc++.so.6, libm.so.6, 
libgcc_s.so.1, libc.so.6, libncurses.so.5, libelf.so.1 and then restart the 
IBM Informix installation program.

which should tell you what is missing.

I managed to build your Dockerfile adding libncurses5 libelf-dev unixodbc-dev to the apt-get install RUN command

OmidRasouli commented 1 year ago

Thanks for your response. I missed some packages that you mentioned and the big problem was Docker's image. I changed python:3.8-slim to ubuntu:focal and it worked.