Skip to content

senzing-garage/docker-db2-driver-installer

Repository files navigation

docker-db2-driver-installer

Overview

The senzing/db2-driver-installer docker image installs redistributable Db2 client code into a mounted volume.

Related artifacts

  1. DockerHub
  2. Helm Chart

Contents

  1. Expectations
    1. Space
    2. Time
    3. Background knowledge
  2. Demonstrate using Docker
    1. Configuration
    2. Volumes
    3. Docker network
    4. Run docker container
  3. Develop
    1. Prerequisite software
    2. Clone repository
    3. Downloads
    4. Build docker image for development
  4. Examples
  5. Errors
  6. References

Legend

  1. 🤔 - A "thinker" icon means that a little extra thinking may be required. Perhaps you'll need to make some choices. Perhaps it's an optional step.
  2. ✏️ - A "pencil" icon means that the instructions may need modification before performing.
  3. ⚠️ - A "warning" icon means that something tricky is happening, so pay attention.

Expectations

Space

This repository and demonstration require 1 GB free disk space.

Time

Budget 20 minutes to get the demonstration up-and-running, depending on CPU and network speeds.

Background knowledge

This repository assumes a working knowledge of:

  1. Docker

Demonstrate using Docker

Configuration

Configuration values specified by environment variable or command line parameter.

Volumes

  1. ✏️ Specify the directory containing the Senzing installation. Use the same SENZING_VOLUME value used when performing "How to initialize Senzing with Docker". Example:

    export SENZING_VOLUME=/opt/my-senzing
    1. Here's a simple test to see if SENZING_VOLUME is correct. The following commands should return file contents. Example:

      cat ${SENZING_VOLUME}/g2/g2BuildVersion.json
      cat ${SENZING_VOLUME}/data/3.0.0/libpostal/data_version
    2. ⚠️ macOS - File sharing must be enabled for SENZING_VOLUME.

    3. ⚠️ Windows - File sharing must be enabled for SENZING_VOLUME.

  2. Specify directory for IBM DB2 drivers. Example:

    export SENZING_OPT_IBM_DIR=${SENZING_VOLUME}/opt-ibm

Docker network

🤔 Optional: Use if docker container is part of a docker network.

  1. List docker networks. Example:

    sudo docker network ls
  2. ✏️ Specify docker network. Choose value from NAME column of docker network ls. Example:

    export SENZING_NETWORK=*nameofthe_network*
  3. Construct parameter for docker run. Example:

    export SENZING_NETWORK_PARAMETER="--net ${SENZING_NETWORK}"

Run docker container

  1. Run docker container. Example:

    sudo docker run \
      --rm \
      --volume ${SENZING_OPT_IBM_DIR}:/opt/IBM \
      ${SENZING_NETWORK_PARAMETER} \
      senzing/db2-driver-installer

Develop

Prerequisite software

The following software programs need to be installed:

  1. git
  2. make
  3. docker

Clone repository

For more information on environment variables, see Environment Variables.

  1. Set these environment variable values:

    export GIT_ACCOUNT=senzing
    export GIT_REPOSITORY=docker-db2-driver-installer
    export GIT_ACCOUNT_DIR=~/${GIT_ACCOUNT}.git
    export GIT_REPOSITORY_DIR="${GIT_ACCOUNT_DIR}/${GIT_REPOSITORY}"
  2. Follow steps in clone-repository to install the Git repository.

Downloads

Download ibm_data_server_driver_for_odbc_cli_linuxx64_v11.1.tar.gz

  1. Visit Download initial Version 11.1 clients and drivers
    1. Click on "IBM Data Server Driver for ODBC and CLI (CLI Driver)" link.
    2. Select 🔘 "IBM Data Server Driver for ODBC and CLI (Linux AMD64 and Intel EM64T)"
    3. Click "Continue" button.
    4. Choose download method and click "Download now" button.
    5. Download ibm_data_server_driver_for_odbc_cli_linuxx64_v11.1.tar.gz to ${GIT_REPOSITORY_DIR}/downloads directory.

Download v11.1.4fp4a_jdbc_sqlj.tar.gz

  1. Visit DB2 JDBC Driver Versions and Downloads
    1. In DB2 Version 11.1 > JDBC 3.0 Driver version, click on "3.72.52" link for "v11.1 M4 FP4 iFix1"
    2. Click on "DSClients--jdbc_sqlj-11.1.4.4-FP004a" link.
    3. Click on "v11.1.4fp4a_jdbc_sqlj.tar.gz" link to download.
    4. Download v11.1.4fp4a_jdbc_sqlj.tar.gz to ${GIT_REPOSITORY_DIR}/downloads directory.

Build docker image for development

  1. Option #1: Using docker command and local repository.

    cd ${GIT_REPOSITORY_DIR}
    sudo docker build --tag senzing/db2-driver-installer .
  2. Option #2: Using make command.

    cd ${GIT_REPOSITORY_DIR}
    sudo make docker-build

    Note: sudo make docker-build-development-cache can be used to create cached docker layers.

Examples

Errors

  1. See docs/errors.md.

References

  1. How to support Db2