Skip to content

senzing-garage/docker-installer

Repository files navigation

docker-installer

If you are beginning your journey with Senzing, please start with Senzing Quick Start guides.

You are in the Senzing Garage where projects are "tinkered" on. Although this GitHub repository may help you understand an approach to using Senzing, it's not considered to be "production ready" and is not considered to be part of the Senzing product. Heck, it may not even be appropriate for your application of Senzing!

Synopsis

Create a docker image that can be used to install Senzing via a cp command.

Overview

This repository shows how to create a Docker image that has Senzing baked-in. The Docker container is used to copy the "baked-in" Senzing files to mounted volumes.

This alleviates the root container requirement seen in the senzing/yum Docker container.

Build Docker container

EULAs

To use the Senzing code, you must agree to the End User License Agreement (EULA).

  1. ⚠️ This step is intentionally tricky and not simply copy/paste. This ensures that you make a conscious effort to accept the EULA. Example:

    export SENZING_ACCEPT_EULA="<the value from this link>"

🤔 If using the the Microsoft MS-SQL database, you must agree to the Microsoft End User License Agreement (EULA). See MSSQL_ACCEPT_EULA.

  1. Optional To install Microsoft's MS-SQL driver (msodbcsql17), accept the Microsoft EULA. Example:

    export MSSQL_ACCEPT_EULA=Y
    

Environment variables

  1. ✏️ Identify the desired Senzing package. Options:

    • senzingapi-poc
    • senzingapi-runtime
    • senzingapi-setup
    • senzingapi-tools

    Example:

    export SENZING_PACKAGE=senzingapi-runtime
    
  2. View the available versions of the Senzing package. Example:

    docker run --rm senzing/apt list -a ${SENZING_PACKAGE}
    
  3. ✏️ From the list in the prior command, choose the desired Senzing version, modify the following, and run. Example:

    export SENZING_PACKAGE_VERSION="4.0.0-00000"
    

Build image

  1. Run the docker build command. Example:

    sudo docker build \
        --build-arg ACCEPT_EULA=${MSSQL_ACCEPT_EULA:-no} \
        --build-arg SENZING_ACCEPT_EULA=${SENZING_ACCEPT_EULA:-no} \
        --build-arg SENZING_APT_INSTALL_PACKAGE="${SENZING_PACKAGE}=${SENZING_PACKAGE_VERSION}" \
        --tag senzing/installer-${SENZING_PACKAGE}:${SENZING_PACKAGE_VERSION} \
        https://github.com/senzing-garage/docker-installer.git#main
    

Run

Environment variables for runtime

  1. ✏️ Identify the Senzing package and version from prior step. Example:

    export SENZING_PACKAGE=senzingapi-runtime
    export SENZING_PACKAGE_VERSION="4.0.0-00000"
    

Output directory

  1. ✏️ Specify where to install Senzing on local system. Example:

    export SENZING_OPT_SENZING_DIR=~/${SENZING_PACKAGE}-${SENZING_PACKAGE_VERSION}
    
  2. Make the output directory. This ensures the correct ownership and permissions on the directory. Example:

    mkdir -p ${SENZING_OPT_SENZING_DIR}
    

Run image

Install only Senzing binaries

  1. Run the docker run command. Example:

    docker run \
        --rm \
        --volume ${SENZING_OPT_SENZING_DIR}:/opt/senzing \
        senzing/installer-${SENZING_PACKAGE}:${SENZING_PACKAGE_VERSION}
    

As different user

🤔 Optional: The Docker container runs as "USER 1001". Use if a different userid (UID) is required. Reference: docker run --user

  1. ✏️ Identify user.

    1. Example #1: Use specific UID. User "0" is root.

      export SENZING_RUNAS_USER="0"
      
    2. Example #2: Use current user.

      export SENZING_RUNAS_USER=$(id -u):$(id -g)
      
  2. Run the docker run command. Example:

    docker run \
        --volume ${SENZING_OPT_SENZING_DIR}:/opt/senzing \
        --user ${SENZING_RUNAS_USER} \
        senzing/installer-${SENZING_PACKAGE}:${SENZING_PACKAGE_VERSION}
    

Install Microsoft MS-SQL Drivers

  1. ✏️ Specify where to install Microsoft drivers and Senzing configuration on local system. Example:

    export SENZING_OPT_MICROSOFT_DIR=${SENZING_OPT_SENZING_DIR}/microsoft
    
  2. Make directories. Example:

    mkdir -p ${SENZING_OPT_MICROSOFT_DIR}
    
  3. Run the docker run command. Example:

    docker run \
        --env SENZING_DEPLOY_OPT_MICROSOFT=true \
        --rm \
        --volume ${SENZING_OPT_SENZING_DIR}:/opt/senzing \
        --volume ${SENZING_OPT_MICROSOFT_DIR}:/opt/microsoft \
        senzing/installer-${SENZING_PACKAGE}:${SENZING_PACKAGE_VERSION}
    

Parameters

Configuration values specified by environment variable or command line parameter.

References