Automation Suite
2022.4
バナーの背景画像
Automation Suite インストール ガイド
最終更新日 2024年4月24日

アップグレード後に古いインストーラーからイメージを削除する方法

アップグレードの実行後にイメージの脆弱性やストレージの消費に関する問題が発生した場合は、古いインストーラーからイメージを削除できます。

このオプションのアップグレード後の操作を実行するには、次の手順を実行します。

  1. 次のスクリプトのクラスター構成に従って、IMGTAGUSERPASSregistrylatest_image_json を更新し、実行します。
    #!/bin/bash
    
    ### Please change below variables as required
    IMG=<E.g. dataservice/dataservice-designer>
    TAG=<E.g. v20231116-tag>
    USER=<E.g. "admin">
    PASS=<E.g. "password">
    registry=<E.g. "registry.mycluster.com">
    latest_image_json=<E.g. "/opt/UiPathAutomationSuite/UiPath_Installer/versions/docker-images.json">
    ####
    
    [[ -f "${latest_image_json}" ]] || {
    	echo "File "$latest_image_json" doesn't exist"
    	exit 1
    }
    
    cat "${latest_image_json}" | tr -d '",' | grep -w "${IMG}:${TAG}" >> /dev/null && {
    	echo "Image ${IMG}:${TAG} is being used in cluster. Will skip the deletion."
    	exit 0
    }
    
    echo "Deleting image ${IMG}:${TAG}"
    
    cred="-u ${USER}:${PASS}"
    
    for i in `curl -k -H 'Accept: application/vnd.docker.distribution.manifest.v2+json' $cred "https://$registry/v2/$IMG/manifests/$TAG" | jq -r '.layers | .[] | .digest'`; do
    	curl -k  -H "Accept: application/vnd.docker.distribution.manifest.v2+json"  $cred -X DELETE "https://$registry/v2/$IMG/manifests/$i"
    done
    
    for i in `curl -k -H 'Accept: application/vnd.docker.distribution.manifest.v2+json' $cred "https://$registry/v2/$IMG/manifests/$TAG" | jq -r '.config.digest'`; do
    	curl -k  -H "Accept: application/vnd.docker.distribution.manifest.v2+json"  $cred -X DELETE "https://$registry/v2/$IMG/manifests/$i"
    done#!/bin/bash
    
    ### Please change below variables as required
    IMG=<E.g. dataservice/dataservice-designer>
    TAG=<E.g. v20231116-tag>
    USER=<E.g. "admin">
    PASS=<E.g. "password">
    registry=<E.g. "registry.mycluster.com">
    latest_image_json=<E.g. "/opt/UiPathAutomationSuite/UiPath_Installer/versions/docker-images.json">
    ####
    
    [[ -f "${latest_image_json}" ]] || {
    	echo "File "$latest_image_json" doesn't exist"
    	exit 1
    }
    
    cat "${latest_image_json}" | tr -d '",' | grep -w "${IMG}:${TAG}" >> /dev/null && {
    	echo "Image ${IMG}:${TAG} is being used in cluster. Will skip the deletion."
    	exit 0
    }
    
    echo "Deleting image ${IMG}:${TAG}"
    
    cred="-u ${USER}:${PASS}"
    
    for i in `curl -k -H 'Accept: application/vnd.docker.distribution.manifest.v2+json' $cred "https://$registry/v2/$IMG/manifests/$TAG" | jq -r '.layers | .[] | .digest'`; do
    	curl -k  -H "Accept: application/vnd.docker.distribution.manifest.v2+json"  $cred -X DELETE "https://$registry/v2/$IMG/manifests/$i"
    done
    
    for i in `curl -k -H 'Accept: application/vnd.docker.distribution.manifest.v2+json' $cred "https://$registry/v2/$IMG/manifests/$TAG" | jq -r '.config.digest'`; do
    	curl -k  -H "Accept: application/vnd.docker.distribution.manifest.v2+json"  $cred -X DELETE "https://$registry/v2/$IMG/manifests/$i"
    done
  2. ガベージ コレクションを実行するためにレジストリ ポッドを再起動するか、レジストリ ポッドを実行し、次のコマンドを使用してガベージ コレクションを実行します。

    registry garbage-collect /etc/docker/registry/config.ymlregistry garbage-collect /etc/docker/registry/config.yml

Was this page helpful?

サポートを受ける
RPA について学ぶ - オートメーション コース
UiPath コミュニティ フォーラム
UiPath ロゴ (白)
信頼とセキュリティ
© 2005-2024 UiPath. All rights reserved.