docker-g2command
โ Deprecated
Deprecated in favor of senzing/g2configtool.
Overview
This Dockerfile is a wrapper over Senzing's G2Command.py.
Related artifacts
Contents
Legend
๐ค - 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.โ๏ธ - A "pencil" icon means that the instructions may need modification before performing.โ ๏ธ - A "warning" icon means that something tricky is happening, so pay attention.
Expectations
Space
This repository and demonstration require 6 GB free disk space.
Time
Budget 40 minutes to get the demonstration up-and-running, depending on CPU and network speeds.
Background knowledge
This repository assumes a working knowledge of:
Demonstrate using Docker
Initialize Senzing
- If Senzing has not been initialized, visit "How to initialize Senzing with Docker".
Configuration
Configuration values specified by environment variable or command line parameter.
- SENZING_DATA_VERSION_DIR
- SENZING_DEBUG
- SENZING_ETC_DIR
- SENZING_G2_DIR
- SENZING_NETWORK
- SENZING_RUNAS_USER
- SENZING_VAR_DIR
Volumes
-
โ๏ธ Specify the directory containing the Senzing installation. Use the sameSENZING_VOLUME
value used when performing "How to initialize Senzing with Docker". Example:export SENZING_VOLUME=/opt/my-senzing
-
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
-
โ ๏ธ macOS - File sharing must be enabled forSENZING_VOLUME
. -
โ ๏ธ Windows - File sharing must be enabled forSENZING_VOLUME
.
-
-
Identify the
data_version
,etc
,g2
, andvar
directories. Example:export SENZING_DATA_VERSION_DIR=${SENZING_VOLUME}/data/3.0.0 export SENZING_ETC_DIR=${SENZING_VOLUME}/etc export SENZING_G2_DIR=${SENZING_VOLUME}/g2 export SENZING_VAR_DIR=${SENZING_VOLUME}/var
Docker network
-
List docker networks. Example:
sudo docker network ls
-
โ๏ธ Specify docker network. Choose value from NAME column ofdocker network ls
. Example:export SENZING_NETWORK=*nameofthe_network*
-
Construct parameter for
docker run
. Example:export SENZING_NETWORK_PARAMETER="--net ${SENZING_NETWORK}"
Docker user
-
โ๏ธ Manually identify user. User "0" is root. Example:export SENZING_RUNAS_USER="0"
Another option, use current user. Example:
export SENZING_RUNAS_USER=$(id -u)
-
Construct parameter for
docker run
. Example:export SENZING_RUNAS_USER_PARAMETER="--user ${SENZING_RUNAS_USER}"
Database support
- Db2: See
Support Db2
instructions to set
SENZING_OPT_IBM_DIR_PARAMETER
. - MS SQL: See
Support MS SQL
instructions to set
SENZING_OPT_MICROSOFT_DIR_PARAMETER
.
Run docker container
-
Run docker container. Example:
sudo docker run \ --interactive \ --rm \ --tty \ --volume ${SENZING_DATA_VERSION_DIR}:/opt/senzing/data \ --volume ${SENZING_ETC_DIR}:/etc/opt/senzing \ --volume ${SENZING_G2_DIR}:/opt/senzing/g2 \ --volume ${SENZING_VAR_DIR}:/var/opt/senzing \ ${SENZING_RUNAS_USER_PARAMETER} \ ${SENZING_NETWORK_PARAMETER} \ ${SENZING_OPT_IBM_DIR_PARAMETER} \ ${SENZING_OPT_MICROSOFT_DIR_PARAMETER} \ senzing/g2command
Develop
Prerequisite software
The following software programs need to be installed:
Clone repository
For more information on environment variables, see Environment Variables.
-
Set these environment variable values:
export GIT_ACCOUNT=senzing export GIT_REPOSITORY=docker-g2command export GIT_ACCOUNT_DIR=~/${GIT_ACCOUNT}.git export GIT_REPOSITORY_DIR="${GIT_ACCOUNT_DIR}/${GIT_REPOSITORY}"
-
Follow steps in clone-repository to install the Git repository.
Build docker image for development
-
Option #1: Using
docker
command and GitHub.sudo docker build --tag senzing/g2command https://github.com/senzing/docker-g2command.git#main
-
Option #2: Using
docker
command and local repository.cd ${GIT_REPOSITORY_DIR} sudo docker build --tag senzing/g2command .
-
Option #3: 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
- See docs/errors.md.