The following instructions show how to pull Docker containers from public Docker registries and push them to a private Docker registry.
- Prerequisites
- Build docker images
- Identify docker images
- Pull images from public Docker registries
- Push images to private Docker registry
- If you need to create a private docker registry, see WHATIS - docker registry server.
🤔 Optional: Build any Docker images that aren't on a public Docker registry.
-
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
-
🤔 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
-
✏️ 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}" )
-
Add docker images to local docker repository. Example:
for DOCKER_IMAGE_NAME in ${DOCKER_IMAGE_NAMES[@]};\ do \ docker pull ${DOCKER_IMAGE_NAME}; \ done
-
✏️ Identify the URL of the private Docker registry. Example:
export DOCKER_REGISTRY_URL=my.docker-registry.com:5000
-
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