

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# のイメージリポジトリ AWS SAM
<a name="serverless-image-repositories"></a>

AWS SAM は、コンテナイメージを構築することで、サーバーレスアプリケーションの継続的インテグレーションおよび継続的デリバリー (CI/CD) タスクを簡素化します。 AWS SAM が提供するイメージには、サポートされている多数の AWS Lambda ランタイム用の AWS SAM コマンドラインインターフェイス (CLI) とビルドツールが含まれています。これは、 AWS SAM CLI を使用したサーバーレスアプリケーションの構築とパッケージ化を容易にします。これらのイメージを CI/CD システムで使用して、 AWS SAM アプリケーションの構築とデプロイを自動化できます。例については「[CI/CD システムとパイプラインを使用したデプロイ](deploying-options.md#serverless-deploying-ci-cd)」を参照してください。

AWS SAM ビルドコンテナイメージ URIsには、そのイメージに含まれる AWS SAM CLIのバージョンがタグ付けされます。タグがない URI を指定すると、最新バージョンが使用されます。例えば、`public.ecr.aws/sam/build-nodejs20.x` は最新のイメージを使用しますが、`public.ecr.aws/sam/build-nodejs20.x:1.24.1` は AWS SAM CLI バージョン 1.24.1 が含まれるイメージを使用します。

のバージョン 1.33.0 以降 AWS SAM CLI、 `x86_64`と `arm64` コンテナイメージの両方がサポートされているランタイムで使用できます。詳細については、*AWS Lambda デベロッパーガイド*の「[Lambda ランタイム](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)」を参照してください。

**注記**  
のバージョン 1.22.0 以前は AWS SAM CLI、DockerHub は がコンテナイメージを AWS SAM CLIプルしたデフォルトのリポジトリでした。バージョン 1.22.0 からは、デフォルトリポジトリが Amazon Elastic Container Registry Public (Amazon ECR Public) に変更されました。現在のデフォルト以外のリポジトリからコンテナイメージをプルするには、**--build-image** オプションが指定された **[sam build](sam-cli-command-reference-sam-build.md)** コマンドを使用できます。このトピックの最後にある例は、DockerHub リポジトリイメージを使用してアプリケーションを構築する方法を示しています。

## イメージリポジトリ URI
<a name="serverless-image-repository-uris"></a>

次の表に、サーバーレスアプリケーションの構築とパッケージ化に使用できる [Amazon ECR Public](https://docs.aws.amazon.com/AmazonECR/latest/public/what-is-ecr.html) ビルドコンテナイメージの URIs を示します AWS SAM。

**注記**  
Amazon ECR Public は、 AWS SAM CLI バージョン1.22.0 以降で DockerHub を置き換えました。以前のバージョンの を使用している場合は AWS SAM CLI、アップグレードすることをお勧めします。


| 実行時間 |  Amazon ECR Public | 
| --- | --- | 
| カスタムランタイム (AL2023) | [public.ecr.aws/sam/build-provided.al2023](https://gallery.ecr.aws/sam/build-provided.al2023) | 
| カスタムランタイム (AL2) | [public.ecr.aws/sam/build-provided.al2](https://gallery.ecr.aws/sam/build-provided.al2) | 
| カスタムランタイム | [public.ecr.aws/sam/build-provided](https://gallery.ecr.aws/sam/build-provided) | 
| Java 25 | [public.ecr.aws/sam/build-java25](https://gallery.ecr.aws/sam/build-java25) | 
| Java 21 | [public.ecr.aws/sam/build-java21](https://gallery.ecr.aws/sam/build-java21) | 
| Java 17 | [public.ecr.aws/sam/build-java17](https://gallery.ecr.aws/sam/build-java17) | 
| Java 11 | [public.ecr.aws/sam/build-java11](https://gallery.ecr.aws/sam/build-java11) | 
| Java 8 | [public.ecr.aws/sam/build-java8](https://gallery.ecr.aws/sam/build-java8) | 
| .NET 9 | [public.ecr.aws/sam/build-dotnet9](https://gallery.ecr.aws/sam/build-dotnet9) | 
| .NET 8 | [public.ecr.aws/sam/build-dotnet8](https://gallery.ecr.aws/sam/build-dotnet8) | 
| .NET 7 | [public.ecr.aws/sam/build-dotnet7](https://gallery.ecr.aws/sam/build-dotnet7) | 
| .NET 6 | [public.ecr.aws/sam/build-dotnet6](https://gallery.ecr.aws/sam/build-dotnet6) | 
| Node.js 24 | [public.ecr.aws/sam/build-nodejs24.x](https://gallery.ecr.aws/sam/build-nodejs24.x) | 
| Node.js 22 | [public.ecr.aws/sam/build-nodejs22.x](https://gallery.ecr.aws/sam/build-nodejs22.x) | 
| Node.js 20 | [public.ecr.aws/sam/build-nodejs20.x](https://gallery.ecr.aws/sam/build-nodejs20.x) | 
| Node.js 18 | [public.ecr.aws/sam/build-nodejs18.x](https://gallery.ecr.aws/sam/build-nodejs18.x) | 
| Node.js 16 | [public.ecr.aws/sam/build-nodejs16.x](https://gallery.ecr.aws/sam/build-nodejs16.x) | 
| Python 3.14 | [public.ecr.aws/sam/build-python3.14](https://gallery.ecr.aws/sam/build-python3.14) | 
| Python 3.13 | [public.ecr.aws/sam/build-python3.13](https://gallery.ecr.aws/sam/build-python3.13) | 
| Python 3.12 | [public.ecr.aws/sam/build-python3.12](https://gallery.ecr.aws/sam/build-python3.12) | 
| Python 3.11 | [public.ecr.aws/sam/build-python3.11](https://gallery.ecr.aws/sam/build-python3.11) | 
| Python 3.10 | [public.ecr.aws/sam/build-python3.10](https://gallery.ecr.aws/sam/build-python3.10) | 
| Python 3.9 | [public.ecr.aws/sam/build-python3.9](https://gallery.ecr.aws/sam/build-python3.9) | 
| Python 3.8 | [public.ecr.aws/sam/build-python3.8](https://gallery.ecr.aws/sam/build-python3.8) | 
| Ruby 3.4 | [public.ecr.aws/sam/build-ruby3.4](https://gallery.ecr.aws/sam/build-ruby3.4) | 
| Ruby 3.3 | [public.ecr.aws/sam/build-ruby3.3](https://gallery.ecr.aws/sam/build-ruby3.3) | 
| Ruby 3.2 | [public.ecr.aws/sam/build-ruby3.2](https://gallery.ecr.aws/sam/build-ruby3.2) | 

## 例
<a name="serverless-image-repository-example-commands"></a>

以下の 2 つのコマンド例は、イメージリポジトリからのコンテナイメージを使用してアプリケーションを構築します。

**Amazon ECR からプルしたコンテナイメージを使用して Node.js 24 アプリケーションを構築**

```
$ sam build --use-container --build-image public.ecr.aws/sam/build-nodejs24.x
```

**Amazon ECR からプルした Python 3.14 コンテナイメージを使用して関数リソースを構築**

```
$ sam build --use-container --build-image Function1=public.ecr.aws/sam/build-python3.14
```