{{CANONICAL}}
← Back to Tech News

AWS SAM CLI adds BuildKit support for AWS Lambda functions packaged as container images

Amazon Web Services has added BuildKit support to its Serverless Application Model Command Line Interface (SAM CLI), enabling developers to build container images for Lambda functions more efficiently. The update, available in SAM CLI version 1.159.0 and later, addresses a key limitation where developers packaging Lambda functions as container images could not access advanced BuildKit features that are essential for production optimization. With the new BuildKit integration, developers can now leverage multi-stage builds to create smaller final images without development dependencies, utilize improved caching mechanisms to reduce rebuild times, and benefit from better parallelization of build steps. The feature also enables cross-architecture builds, allowing developers to target both x86_64 and ARM64 (AWS Graviton2) architectures from a single development machine, while supporting Docker secrets during builds to keep sensitive credentials out of final image layers. To use the new capability, developers need to update to SAM CLI version 1.159.0 or later and add the --use-buildkit flag with the sam build command. The feature works with both Docker and Finch container runtimes, providing full access to BuildKit's advanced capabilities for serverless application development.

Why It Matters

This update addresses a significant gap in AWS's serverless development toolchain by bringing modern container build capabilities to Lambda function development. BuildKit's advanced features like multi-stage builds and cross-architecture compilation are increasingly essential for production deployments, especially as organizations adopt ARM-based Graviton processors for cost optimization. The addition makes SAM CLI more competitive with other container build tools and streamlines the development workflow for containerized serverless applications.

Read Original Release →
Note

This summary is generated using AI analysis of the original press release. Always refer to the original source for complete details.