Image repositories for Amazon SAM
Amazon SAM simplifies continuous integration and continuous delivery (CI/CD) tasks for serverless applications with the help of build container images. The images that Amazon SAM provides include the Amazon SAM command line interface (CLI) and build tools for a number of supported Amazon Lambda runtimes. This make it easier to build and package serverless applications using the Amazon SAM CLI. You can use these images with CI/CD systems to automate the building and deployment of Amazon SAM applications. For examples, see Deploy with CI/CD systems and pipelines.
Amazon SAM build container image URIs are tagged with the version of the Amazon SAM CLI included in
that image. If you specify the untagged URI, then the latest version is used. For example,
public.ecr.aws/sam/build-nodejs20.x
uses the latest image. However,
public.ecr.aws/sam/build-nodejs20.x:1.24.1
uses the the image containing Amazon SAM
CLI version 1.24.1.
Starting with version 1.33.0 of the Amazon SAM CLI, both x86_64
and
arm64
container images are available for supported runtimes. For more
information, see Lambda
runtimes in the Amazon Lambda Developer Guide.
Note
Prior to version 1.22.0 of the Amazon SAM CLI, DockerHub was the default repository that the Amazon SAM CLI pulled the container image from. Starting with version 1.22.0, the default repository changed to Amazon Elastic Container Registry Public (Amazon ECR Public). To pull a container image from a repository other than the current default, you can use the sam build command with the --build-image option. The examples at the end of this topic show how to build applications using DockerHub repository images.
Image repository URIs
The following table lists the URIs of Amazon ECR Public build container images that you can use to build and package serverless applications with Amazon SAM.
Note
Amazon ECR Public replaced DockerHub starting with the Amazon SAM CLI version 1.22.0. If you are using an earlier version of the Amazon SAM CLI, we recommend that you upgrade.
Examples
The following two example commands build applications using container images from the image repository:
Build a Node.js 22 application using a container image pulled from Amazon ECR:
$
sam build --use-container --build-image
public.ecr.aws/sam/build-nodejs22.x
Build a function resource using the Python 3.13 container image pulled from Amazon ECR:
$
sam build --use-container --build-image
Function1=public.ecr.aws/sam/build-python3.13