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

AWS SAM CLI BuildKit Support
AWS SAM CLI now supports BuildKit for building container images from Dockerfiles, enabling faster and more efficient container image builds for Lambda functions packaged as container images.
New Features
- Multi-stage builds to create smaller final images without development dependencies.
- Improved caching to reduce rebuild times.
- Better parallelization of build steps.
- Cross-architecture builds for x86_64 and arm64 (AWS Graviton2) instruction set architectures.
- Use Docker secrets during builds to keep sensitive data out of final image layers.
What to do
- Download or update SAM CLI to version 1.159.0 or later.
- Use the --use-buildkit flag with sam build.
- This feature works with both Docker and Finch.
To learn more, visit the SAM CLI developer guide.
Source: AWS release notes
If you need further guidance on AWS, our experts are available at AWS@westloop.io. You may also reach us by submitting the Contact Us form.



