Setting IBM_DB_HOME prevents pip install ibm_db

Viewed 335

I'm trying to install clidriver v11.1 for linux because I want it for use with airflow. The drivers are hosted here: https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/

The driver I'm assuming I want is s390_odbc_cli.tar.gz The reason I want v11.1 is because my license is for v11.1.

Here is my dockerfile:

FROM apache/airflow:2.2.5

ENV IBM_DB_HOME /home/airflow/.local/lib/python3.7/site-packages/clidriver
ENV LD_LIBRARY_PATH ${IBM_DB_HOME}/lib

USER root
RUN apt-get update \
  && apt-get install -y gcc \
  && curl https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/s390_odbc_cli.tar.gz > /home/airflow/.local/lib/python3.7/site-packages/s390_odbc_cli.tar.gz \
  && gunzip /home/airflow/.local/lib/python3.7/site-packages/s390_odbc_cli.tar.gz \
  && tar -xvf /home/airflow/.local/lib/python3.7/site-packages/s390_odbc_cli.tar \
  && rm -rf /home/airflow/.local/lib/python3.7/site-packages/s390_odbc_cli.tar.gz 

COPY --chown=airflow:root db2consv_as.lic /home/airflow/.local/lib/python3.7/site-packages/clidriver/license/
USER airflow

RUN pip install ibm_db openpyxl

This is the error I get after typing "docker-compose build --no-cache":

 > [airflow_airflow-webserver 4/4] RUN pip install ibm_db openpyxl:
#18 1.418 Collecting ibm_db
#18 1.756   Downloading ibm_db-3.1.1.tar.gz (1.1 MB)
#18 3.415   Installing build dependencies: started
#18 10.43   Installing build dependencies: finished with status 'done'
#18 10.43   Getting requirements to build wheel: started
#18 10.79   Getting requirements to build wheel: finished with status 'done'
#18 10.79 ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: '/tmp/tmpop61swp9/output.json'

the tmp**** directory changes its numbers each time I build.

If I simply remove the environment variables, then I get a successful build, but with clidriver v11.5. This is found when I run db2level:

Informational tokens are "DB2 v11.5.6.0",

Am I incorrectly installing the driver manually? or something wrong with how I'm setting the environment variables?

0 Answers
Related