Db2

Db2

Connect with Db2, Informix, Netezza, open source, and other data experts to gain value from your data, share insights, and solve problems.

 View Only
  • 1.  Deploying DB2 .NET 8 application to EKS

    Posted Tue September 10, 2024 04:24 PM

    Hi Team,

    I am trying to deploy DB2 .NET 8 application to EKS, but it is failing to connect DB2 on-prem from EKS
    I am using Jenkins pipeline and DockerFile for deployment.

    Getting Error as Unable to load shared library libdb2.so
    libxm2.so.2: No such file or directory

    Base image I tried was Debian Bookworm and RedHat UBI 8.0

    With .NET 6 it was working but now I upgraded the application to .NET 8 and getting this issue

    Kindly help 



    ------------------------------
    ulhas chaudhary
    ------------------------------


  • 2.  RE: Deploying DB2 .NET 8 application to EKS

    Posted Wed September 11, 2024 01:22 AM
    Edited by Michael Volz Wed September 11, 2024 07:06 AM

    Hello,

    are you using the correct nuget package? I'm using the following package references:

    <PackageReference Include="IBM.EntityFrameworkCore" Version="8.0.0.300" Condition="'$(os)' == 'Windows_NT'" />
    <PackageReference Include="IBM.EntityFrameworkCore-lnx" Version="8.0.0.200" Condition="'$(os)' == 'UNIX'" />

    Have you set the environment variables that are needed for DB2 to function in the docker file?

    This is how the bottom of my dockerfile looks like:

    FROM base AS final
    WORKDIR /app
    COPY --from=publish /app/publish .
    
    # Environment variables for DB2 to function
    ENV LD_LIBRARY_PATH=/app/clidriver/lib:/app/clidriver/lib/icc
    ENV DB2_CLI_DRIVER_INSTALL_PATH=/app/clidriver
    ENV PATH=$PATH:/app/clidriver/bin

    Also you will need to install libxml2 into the docker image:

    #install libxml2
    RUN apt-get update && apt-get install -y libxml2-dev



    ------------------------------
    Michael Volz
    ------------------------------



  • 3.  RE: Deploying DB2 .NET 8 application to EKS

    Posted Thu September 19, 2024 08:08 AM

    @ulhas chaudhary have you been able to fix your issue?



    ------------------------------
    Michael Volz
    ------------------------------