

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 為互動端點自訂 Docker 映像檔
<a name="docker-custom-images-managed-endpoint"></a>

也可以為互動端點自訂 Docker 映像檔，以便執行自訂的基礎核心映像。這有助於確保從 EMR Studio 執行互動式工作負載時擁有所需的相依性。

1. 請依照上述[步驟 1-4](https://docs.aws.amazon.com/emr/latest/EMR-on-EKS-DevelopmentGuide/docker-custom-images-steps.html#docker-custom-images-retrieve) 自訂 Docker 映像檔。對於 Amazon EMR 6.9.0 及更高版本，您可從 Amazon ECR 公共映像庫中獲取基礎映像 URI。對於 Amazon EMR 6.9.0 之前的版本，可以在每個 AWS 區域的 Amazon EMR Registry 帳戶中獲取映像，唯一的區別是 Dockerfile 中的基礎映像 URI。基礎映像 URI 的格式如下：

   ```
   ECR-registry-account.dkr.ecr.Region.amazonaws.com/notebook-spark/container-image-tag
   ```

   需要在基礎映像 URI 中使用 `notebook-spark` 而非 `spark`。基礎映像包含 Spark 執行期和隨之一起執行的筆記本核心。如需有關選取區域和容器映像標籤的詳細資訊，請參閱 [選取基礎映像 URI 的詳細資訊](docker-custom-images-tag.md)。
**注意**  
目前僅支援覆寫基礎映像，且不支援引入非基礎映像 AWS 提供之其他類型的全新核心。

1. 建立可與自訂映像搭配使用的互動端點。

   首先，建立稱為 `custom-image-managed-endpoint.json` 的 JSON 檔案，其中具有以下內容。

   ```
   {
       "name": "endpoint-name",
       "virtualClusterId": "virtual-cluster-id",
       "type": "JUPYTER_ENTERPRISE_GATEWAY",
       "releaseLabel": "emr-6.6.0-latest",
       "executionRoleArn": "execution-role-arn",
       "certificateArn": "certificate-arn",
       "configurationOverrides": {
           "applicationConfiguration": [
               {
                   "classification": "jupyter-kernel-overrides",
                   "configurations": [
                       {
                           "classification": "python3",
                           "properties": {
                               "container-image": "123456789012.dkr.ecr.us-west-2.amazonaws.com/custom-notebook-python:latest"
                           }
                       },
                       {
                           "classification": "spark-python-kubernetes",
                           "properties": {
                               "container-image": "123456789012.dkr.ecr.us-west-2.amazonaws.com/custom-notebook-spark:latest"
                           }
                       }
                   ] 
               }
           ]
       }
   }
   ```

   接下來，使用 JSON 檔案中指定的組態建立互動端點，如下列範例所示。

   ```
   aws emr-containers create-managed-endpoint --cli-input-json custom-image-managed-endpoint.json
   ```

   如需詳細資訊，請參閱[為虛擬叢集建立互動端點](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-studio-create-eks-cluster.html#emr-studio-create-managed-endpoint)。

1. 透過 EMR Studio 連接至互動端點。如需詳細資訊，請參閱[從 Studio 連接](https://emr-on-eks.workshop.aws/advanced/emr-studio/connecting-from-studio.html)。