Skip to content

Latest commit

 

History

History
54 lines (40 loc) · 1.41 KB

demonstrate-using-docker.md

File metadata and controls

54 lines (40 loc) · 1.41 KB

Demonstrate using Docker

As micro-service

This option starts a micro-service supporting HTTP requests.

  1. Run the docker container. Example:

    curl -X GET \
      --output ${SENZING_VOLUME}/docker-versions-stable.sh \
      https://raw.githubusercontent.com/Senzing/knowledge-base/main/lists/docker-versions-stable.sh
    source ${SENZING_VOLUME}/docker-versions-stable.sh
    
    docker run \
      --publish 8252:8252 \
      --rm \
      senzing/resolver:${SENZING_DOCKER_IMAGE_VERSION_RESOLVER:-latest}
  2. Test HTTP API. Once service has started, try the HTTP requests.

As file input/output

This Option uses file input and output.

  1. ✏️ Set environment variables. Example:

    export DATA_DIR=${GIT_REPOSITORY_DIR}/test
  2. Run docker container. Example:

    curl -X GET \
      --output ${SENZING_VOLUME}/docker-versions-stable.sh \
      https://raw.githubusercontent.com/Senzing/knowledge-base/main/lists/docker-versions-stable.sh
    source ${SENZING_VOLUME}/docker-versions-stable.sh
    
    docker run \
      --rm \
      --volume ${DATA_DIR}:/data \
      senzing/resolver:${SENZING_DOCKER_IMAGE_VERSION_RESOLVER:-latest} file-input \
        --input-file  /data/test-data-1.json \
        --output-file /data/my-output.json
  3. Output will be on workstation at ${DATA_DIR}/my-output.json