Image repositories for AWS SAM - AWS Serverless Application Model

Image repositories for AWS SAM

AWS SAM simplifies continuous integration and continuous delivery (CI/CD) tasks for serverless applications with the help of build container images. The images that AWS SAM provides include the AWS SAM command line interface (CLI) and build tools for a number of supported AWS Lambda runtimes. This make it easier to build and package serverless applications using the AWS SAM CLI. You can use these images with CI/CD systems to automate the building and deployment of AWS SAM applications. For examples, see Deploy with CI/CD systems and pipelines.

AWS SAM build container image URIs are tagged with the version of the AWS 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 AWS SAM CLI version 1.24.1.

Starting with version 1.33.0 of the AWS SAM CLI, both x86_64 and arm64 container images are available for supported runtimes. For more information, see Lambda runtimes in the AWS Lambda Developer Guide.

Note

Prior to version 1.22.0 of the AWS SAM CLI, DockerHub was the default repository that the AWS 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 AWS SAM.

Note

Amazon ECR Public replaced DockerHub starting with the AWS SAM CLI version 1.22.0. If you are using an earlier version of the AWS SAM CLI, we recommend that you upgrade.

Examples

The following two example commands build applications using container images from the DockerHub repository:

Build a Node.js 20 application using a container image pulled from DockerHub:

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

Build a function resource using the Python 3.12 container image pulled from DockerHub:

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