Back to news
cloud Priority 4/5 5/6/2026, 11:05:48 AM

AWS SAM CLI Adds BuildKit Support for AWS Lambda Functions Packaged as Container Images

AWS SAM CLI Adds BuildKit Support for AWS Lambda Functions Packaged as Container Images

AWS has updated the SAM CLI to support BuildKit for developers who package their Lambda functions as container images. BuildKit is a modern build engine for Docker that introduces advanced features such as parallelized build stages and more efficient caching mechanisms. By leveraging these capabilities, developers can significantly reduce the time required to build and iterate on serverless applications during the development lifecycle. This integration allows for a more streamlined workflow when managing complex container environments for serverless workloads. Using BuildKit enables more sophisticated build-time optimizations that were previously difficult to achieve with the standard Docker build process. It also provides better handling of secrets and SSH forwarding during the image construction phase. Engineers can enable this feature through the SAM CLI configuration or environment variables, allowing for seamless integration into existing CI/CD pipelines. This update specifically targets the build phase of the SAM workflow for container-based deployments. Users should ensure their local Docker environment or build runners support BuildKit to take full advantage of these performance improvements. Detailed implementation steps and compatibility requirements are available in the official AWS documentation for the SAM CLI.

Related tools

Recommended tools for this topic

These picks prioritize high-intent tools relevant to this topic. Some links may include partner or affiliate tracking.

#aws#cloud#official#general:products/aws-serverless-application-model-sam,marketing:marchitecture/developer-tools,marketing:marchitecture/serverless,general:products/aws-lambda

Comparison

AspectBefore / AlternativeAfter / This
Build ExecutionSequential processing of build stagesParallelized execution of independent build stages
Caching MechanismBasic layer-based cachingEfficient, granular caching for faster rebuilds
Output ManagementStandard console output during image creationHigh-concurrency progress tracking with detailed logs
Build PerformanceHigher latency during complex image constructionReduced build times via concurrent processing

Action Checklist

  1. Update AWS SAM CLI to the latest version Ensure your local environment meets the minimum version requirements for BuildKit support
  2. Enable BuildKit in your Docker configuration Set the DOCKER_BUILDKIT environment variable to 1
  3. Modify the sam build command to utilize the new engine Check for any new CLI flags specifically for container image builds
  4. Test existing Dockerfiles for compatibility Verify that advanced BuildKit syntax does not conflict with existing SAM templates
  5. Update CI/CD pipeline environment variables Ensure build runners have the necessary Docker engine versions and configurations

Source: AWS What's New

This page summarizes the original source. Check the source for full details.

Related