Db2

 View Only

How to build Kubernetes container being able to do "db2 export" - connecting to remote db2 server

  • 1.  How to build Kubernetes container being able to do "db2 export" - connecting to remote db2 server

    Posted Mon October 04, 2021 10:00 AM
    I need to build a Kubernetes container running on IBM Cloud containing my own bash scripts - and also include some db2 image that will allow me to do "db2 export" statements. The export must be from a remotely connected db2 server on ibm cloud.
    This means I don't need a full db2 installed - just a db2 client and the possibility to do db2 commands and define remote connections.

    I have tried to use the ibmcom/db2 image in a Dockerfile, but it fails during initial run in the setup_db2_instance.sh. Also I'm not sure if it is allowed to be used in a production environment.
    I have not added anything for a persistant volume as the Dockerfile doesn't allow mapping in a VOLUME statement.....
    Extract from Dockerfile - that fails:
    FROM ibmcom/db2
    ENV LICENSE=accept
    ENV DB2INSTANCE=db2inst1
    ENV DBNAME=INITIAL
    # Install my script
    COPY ./src /myscripts
    COPY ./src/setup_connection.sh /var/custom/setup_connection.sh
    RUN /var/db2_setup/lib/setup_db2_instance.sh
    CMD ["echo", "My scripts installed"]


    So - is the ibmcom/db2 image the correct way to go forward ? Or what else should I do ?
    Please direct me - thanks

    Morten Hansen, IBM Denmark

    ------------------------------
    Morten Hansen
    ------------------------------

    #Db2