2.5. Uploading container images to a mirror registry


To use your container images at an air-gapped site, upload them to the mirror registry using the following procedure.

Prerequisites

  • You are logged into a host with access to microshift-quay.
  • The .pull-secret-mirror.json file is available locally.
  • The microshift-containers directory contents are available locally.

Procedure

  1. Install the skopeo tool used for copying the container images by running the following command:

    $ sudo dnf install -y skopeo
  2. Set the environment variables pointing to the pull secret file:

    $ IMAGE_PULL_FILE=~/.pull-secret-mirror.json
  3. Set the environment variables pointing to the local container image directory:

    $ IMAGE_LOCAL_DIR=~/microshift-containers
  4. Set the environment variables pointing to the mirror registry URL for uploading the container images:

    $ TARGET_REGISTRY=<registry_host>:<port> 
    1
    1
    Replace <registry_host>:<port> with the host name and port of your mirror registry server.
  5. Run the following script to upload the container images to the ${TARGET_REGISTRY} mirror registry:

    pushd "${IMAGE_LOCAL_DIR}" >/dev/null
    while read -r src_manifest ; do
      local src_img
      src_img=$(dirname "${src_manifest}")
      # Add the target registry prefix and remove SHA
      local -r dst_img="${TARGET_REGISTRY}/${src_img}"
      local -r dst_img_no_tag="${TARGET_REGISTRY}/${src_img%%[@:]*}"
      # Run the image upload
      echo "Uploading '${src_img}' to '${dst_img}'"
      skopeo copy --all --quiet \
         --preserve-digests \
         --authfile "${IMAGE_PULL_FILE}" \
         dir://"${IMAGE_LOCAL_DIR}/${src_img}" docker://"${dst_img}"
    done < <(find . -type f -name manifest.json -printf '%P\n')
    popd >/dev/null
Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

Red Hat ドキュメントについて

Legal Notice

Theme

© 2026 Red Hat
トップに戻る