/docker-apt

Dockerfile wrapping `apt-get`, a package manager.

Primary LanguageMakefileApache License 2.0Apache-2.0

docker-apt

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

A Docker wrapper over the apt command.

Overview

This repository creates a Docker wrapper over the apt command. It can be used to download and extract "deb" files. The default behavior is to install the latest senzingapi packages.

Contents

  1. Preamble
    1. Legend
  2. Related artifacts
  3. Expectations
  4. Demonstrate using Docker
    1. EULA
    2. Docker volumes
    3. Run Docker container
  5. Develop
    1. Prerequisites for development
    2. Clone repository
    3. Build Docker image
  6. Examples
    1. Examples of Docker
  7. Advanced
    1. Configuration
  8. Errors
  9. References

Preamble

At Senzing, we strive to create GitHub documentation in a "don't make me think" style. For the most part, instructions are copy and paste. Whenever thinking is needed, it's marked with a "thinking" icon 🤔. Whenever customization is needed, it's marked with a "pencil" icon ✏️. If the instructions are not clear, please let us know by opening a new Documentation issue describing where we can improve. Now on with the show...

Legend

  1. 🤔 - A "thinker" icon means that a little extra thinking may be required. Perhaps there are some choices to be made. 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.

Related artifacts

  1. DockerHub
  2. Helm Chart

Expectations

  • Space: This repository and demonstration require 6 GB free disk space.
  • Time: Budget 10 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

EULA

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>"

Docker volumes

Senzing follows the Linux File Hierarchy Standard. Environment variables will be used in --volume options to externalize the installations.

  1. ✏️ Specify the directory where to install Senzing. Example:

    export SENZING_VOLUME=~/my-senzing
    1. ⚠️ macOS - File sharing must be enabled for SENZING_VOLUME.
    2. ⚠️ Windows - File sharing must be enabled for SENZING_VOLUME.

Run Docker container

  1. Run Docker container. Example:

    docker run \
      --env SENZING_ACCEPT_EULA=${SENZING_ACCEPT_EULA} \
      --rm \
      --volume ${SENZING_VOLUME}:/opt/senzing \
      senzing/apt
  2. When complete, Senzing is installed in the SENZING_VOLUME directory.

  3. For more examples of use, see Examples of Docker.

Develop

The following instructions are used when modifying and building the Docker image.

Prerequisites for development

🤔 The following tasks need to be complete before proceeding. These are "one-time tasks" which may already have been completed.

  1. 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-apt
    export GIT_ACCOUNT_DIR=~/${GIT_ACCOUNT}.git
    export GIT_REPOSITORY_DIR="${GIT_ACCOUNT_DIR}/${GIT_REPOSITORY}"
  2. Using the environment variables values just set, follow steps in clone-repository to install the Git repository.

Build Docker image

  1. Option #1: Using docker command and GitHub.

    sudo docker build \
      --tag senzing/apt \
      https://github.com/senzing-garage/docker-apt.git#main
  2. Option #2: Using docker command and local repository.

    cd ${GIT_REPOSITORY_DIR}
    sudo docker build --tag senzing/apt .
  3. 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

Examples of Docker

The following examples require initialization described in Demonstrate using Docker.

Manually accept EULA

By not setting SENZING_ACCEPT_EULA_PARAMETER, the containerized yum install will prompt for manual EULA acceptance.

  1. Run Docker container. Example:

    sudo docker run \
      --interactive \
      --rm \
      --tty \
      --volume ${SENZING_VOLUME}:/opt/senzing \
      senzing/apt

Install local DEB files

senzing/apt can be used to install local DEB files.

  1. To download Senzing DEB file, see github.com/Senzing/docker-aptdownloader.

  2. ✏️ Set additional environment variables. Identify directory containing DEB files and the exact names of the DEB files. Example:

    export SENZING_DEB_DIR=~/Downloads
    export SENZING_API_DEB_FILENAME=senzingapi-nn.nn.nn.x86_64.rpm
    export SENZING_DATA_DEB_FILENAME=senzingdata-v1-nn.nn.nn.x86_64.rpm
  3. Run the Docker container. Example:

    sudo docker run \
      --env SENZING_ACCEPT_EULA=${SENZING_ACCEPT_EULA} \
      --rm \
      --volume ${SENZING_VOLUME}:/opt/senzing \
      --volume ${SENZING_DEB_DIR}:/data \
      senzing/apt -y localinstall \
        /data/${SENZING_DATA_DEB_FILENAME} \
        /data/${SENZING_API_DEB_FILENAME}

Advanced

Configuration

Configuration values specified by environment variable or command line parameter.

Errors

  1. See docs/errors.md.

References