共用方式為


在 Azure Stack Hub 上安裝 Azure Container Registry

您可以在 Azure Stack Hub 上安裝 Azure Container Registry (ACR),並將其提供給您的使用者,讓他們可以在您的環境中裝載容器。 若要安裝 ACR,您必須產生並驗證憑證,然後安裝 ACR。 您可以透過 Azure Stack Hub 系統管理入口網站進行安裝。

重要

安裝之後,系統會將 Azure Stack Hub 上的 Azure Container Registry 視為基礎 RP,且無法將其解除安裝。 操作員仍然可以透過供應項目、方案和配額,來限制 ACR 服務的使用者存取。

必要條件

  • Azure Stack Hub 版本
    您只能在執行 2108 更新,和更新版本的 Azure Stack Hub 整合系統中啟用 Microsoft Azure 容器。 完成本文中的步驟之前,請先安裝 Azure Stack Hub 更新。 Azure Stack 開發人員套件 (ASDK) 部署不支援 Azure Container Registry (ACR) 服務。

  • 憑證需求
    Azure Stack Hub 系統上的 ACR 設定會新增需要憑證的新資料路徑。 憑證的需求必須與其他憑證的需求相同,以便安裝並操作 Azure Stack Hub。 此外,它不得為 Cyptography:新一代 (CNG) 憑證,因為 Azure Stack Hub 上的 ACR 公開預覽目前不支援這些憑證。 如需詳細資訊,請參閱此文章 「Azure Stack Hub 公開金鑰基礎結構 (PKI) 憑證需求。」

    此新憑證的 URI 應該具有下列格式:

    *.azsacr.<region>.<fqdn>

    例如:

    *.azsacr.azurestack.contoso.com

  • Azure Stack Hub 狀態
    只有在驗證 Azure Stack Hub 狀況良好之後,才應該安裝 ACR。 您可以遵循「驗證 Azure Stack Hub 系統狀態」上所列的步驟來執行這項操作。

產生您的憑證

您可以使用下列步驟,使用 Azure Stack Hub 整備檢查工具來產生 ACR 憑證。 您必須指定 Microsoft.AzureStack.ReadinessChecker 的模組版本才能繼續進行步驟。

  1. 使用已提升權限的提示字元開啟 PowerShell。

  2. 執行下列 Cmdlet:

    Install-Module -Name Microsoft.AzureStack.ReadinessChecker 
    New-Item -ItemType Directory "$ENV:USERPROFILE\Documents\AzsCertRequests"
        $certificateRequestParams = @{
            'regionName' = 'azurestack'
            'externalFQDN' = 'contoso.com'
            'subject' = "C=US,ST=Washington,L=Redmond,O=Microsoft,OU=Azure Stack"
            'OutputRequestPath' = "$ENV:USERPROFILE\Documents\AzsCertRequests" }
    New-AzsHubAzureContainerRegistryCertificateSigningRequest @certificateRequestParams
    
  3. ReadinessChecker 模組建立 .req** 檔案時,請將該檔案附屬於您的憑證授權單位單位 (CA) (內部或公用)。 New-AzsCertificateSigningRequest 的輸出目錄包含必須提交給 CA 的 CSR。 如需參考,此目錄也包含一個子目錄,其中包含在憑證要求產生期間所使用的 INF 檔案。

驗證 ACR 憑證

驗證符合 Azure Stack Hub 需求的 ACR 憑證。

  1. 將由 CA (支援的副檔名 .cer、.cert、.srt、.pfx) 簽署的產生憑證檔案 (.cer) 複製到 $ENV:USERPROFILE\Documents\AzureStack

  2. 從已提升權限的提示字元中,執行下列 PowerShell Cmdlet:

    Install-Module -Name Microsoft.AzureStack.ReadinessChecker 
    $Path = "$ENV:USERPROFILE\Documents\AzureStack"
    $pfxPassword = Read-Host -AsSecureString -Prompt "PFX Password"
    ConvertTo-AzsPFX -Path $Path -pfxPassword $pfxPassword -ExportPath $Path
    

安裝步驟

您可以使用下列步驟,在 Azure Stack Hub 中安裝 ACR 服務。

入口網站

您可以使用 Azure Stack Hub 系統管理入口網站,來匯入憑證並安裝服務。

  1. 登入 Azure Stack Hub 系統管理入口網站。

  2. 瀏覽至所有服務>容器登錄取得 Azure Stack Hub 容器登錄。

  3. 輸入 SSL 憑證的完整路徑。

  4. 輸入憑證的密碼。

  5. 選取 [部署]。
    安裝 ACR 服務最多可能需要一小時。

    已安裝 Azure Stack Hub 容器登錄。

  6. 在 Azure Stack Hub 系統管理入口網站中完成安裝之後,請關閉並重新開啟容器登錄刀鋒視窗。

完成安裝之後,您可以在 Azure Stack Hub 系統管理入口網站中,檢閱或更新配額的容量。

後續步驟

Azure Stack Hub 上的 Azure Container Registries 概觀