Skip to content

Latest commit

 

History

History
96 lines (68 loc) · 2.63 KB

add-docker-images-to-private-registry.md

File metadata and controls

96 lines (68 loc) · 2.63 KB

How to add Docker images to private registry

The following instructions show how to pull Docker containers from public Docker registries and push them to a private Docker registry.

Contents

  1. Prerequisites
  2. Build docker images
  3. Identify docker images
  4. Pull images from public Docker registries
  5. Push images to private Docker registry

Prerequisites

  1. If you need to create a private docker registry, see WHATIS - docker registry server.

Build docker images

🤔 Optional: Build any Docker images that aren't on a public Docker registry.

  1. Build Senzing "helper" Docker images. Example:

    docker build --tag senzing/mysql        https://github.com/senzing-garage/docker-mysql.git#main
    docker build --tag senzing/mysql-init   https://github.com/senzing-garage/docker-mysql-init.git#main
    

Identify docker images

  1. 🤔 Optional: Specify versions of Docker images. Example:

    curl -X GET \
        --output /tmp/docker-versions-stable.sh \
        https://raw.githubusercontent.com/Senzing/knowledge-base/main/lists/docker-versions-stable.sh
    source /tmp/docker-versions-stable.sh
    
  2. ✏️ List docker images in DockerHub in an environment variable. Add or delete Docker images from the list. For extensive list, see docker-image-names.sh Example:

    export DOCKER_IMAGE_NAMES=(
        "senzing/senzingapi-runtime:${SENZING_DOCKER_IMAGE_VERSION_SENZINGAPI_RUNTIME:-latest}"
    )
    

Pull images from public Docker registries

  1. Add docker images to local docker repository. Example:

    for DOCKER_IMAGE_NAME in ${DOCKER_IMAGE_NAMES[@]};\
    do \
      docker pull ${DOCKER_IMAGE_NAME}; \
    done
    

Push images to private Docker registry

  1. ✏️ Identify the URL of the private Docker registry. Example:

    export DOCKER_REGISTRY_URL=my.docker-registry.com:5000
  2. Push Docker images to private docker registry. Example:

    for DOCKER_IMAGE_NAME in ${DOCKER_IMAGE_NAMES[@]};\
    do
      docker tag  ${DOCKER_IMAGE_NAME} ${DOCKER_REGISTRY_URL}/${DOCKER_IMAGE_NAME};
      docker push ${DOCKER_REGISTRY_URL}/${DOCKER_IMAGE_NAME};
      docker rmi  ${DOCKER_REGISTRY_URL}/${DOCKER_IMAGE_NAME};
    done