Skip to content

senzing-factory/dockerhub-util

Repository files navigation

dockerhub-util

Synopsis

Utilities for working with hub.docker.com registry and repositories.

Overview

The dockerhub-util.py python script works with DockerHub metadata.

To see all of the subcommands, run:

$ ./dockerhub-util.py --help
usage: dockerhub-util.py [-h]
                         {print-latest-versions,sleep,version,docker-acceptance-test}
                         ...

Reports from DockerHub. For more information, see
https://github.com/Senzing/dockerhub-util

positional arguments:
  {print-latest-versions,sleep,version,docker-acceptance-test}
                        Subcommands (SENZING_SUBCOMMAND):
    print-latest-versions
                        Print latest versions of Docker images.
    sleep               Do nothing but sleep. For Docker testing.
    version             Print version of program.
    docker-acceptance-test
                        For Docker acceptance testing.

optional arguments:
  -h, --help            show this help message and exit

Contents

  1. Preamble
    1. Legend
  2. Expectations
  3. Demonstrate using command-line interface
    1. Prerequisites for CLI
    2. Download
    3. Run command
  4. Demonstrate using Docker
    1. Prerequisites for Docker
    2. Run Docker container
  5. Configuration
  6. 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.

Expectations

  • Space: This repository and demonstration require 3 MB 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:

Demonstrate using command-line interface

Prerequisites for CLI

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

  1. Install system dependencies:
    1. Use apt based installation for Debian, Ubuntu and others
      1. See apt-packages.txt for list
    2. Use yum based installation for Red Hat, CentOS, openSuse and others.
      1. See yum-packages.txt for list
  2. Install Python dependencies:
    1. See requirements.txt for list
      1. Installation hints

Download

  1. Get a local copy of template-python.py. Example:

    1. ✏️ Specify where to download file. Example:

      export SENZING_DOWNLOAD_FILE=~/dockerhub-util.py
    2. Download file. Example:

      curl -X GET \
        --output ${SENZING_DOWNLOAD_FILE} \
        https://raw.githubusercontent.com/Senzing/dockerhub-util/main/dockerhub-util.py
    3. Make file executable. Example:

      chmod +x ${SENZING_DOWNLOAD_FILE}
  2. 🤔 Alternative: The entire git repository can be downloaded by following instructions at Clone repository

Run command

  1. Run the command. Example:

    ${SENZING_DOWNLOAD_FILE} --help
  2. For more examples of use, see Examples of CLI.

Demonstrate using Docker

Prerequisites for Docker

🤔 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. docker

Run Docker container

Although the Docker run command looks complex, it accounts for all of the optional variations described above. Unset *_PARAMETER environment variables have no effect on the docker run command and may be removed or remain.

  1. Run Docker container. Example:

    sudo docker run \
      --rm \
      senzing/dockerhub-util
  2. For more examples of use, see Examples of Docker.

Configuration

Configuration values specified by environment variable or command-line parameter.

References

  1. Bitnami's Best Practices for Securing and Hardening Container Images
  2. Development
  3. Errors
  4. Examples
  5. Related artifacts:
    1. DockerHub