feat: add cli client support for image builds to enable buildkit#8772
Merged
reedham-aws merged 5 commits intodevelopfrom Mar 10, 2026
Merged
feat: add cli client support for image builds to enable buildkit#8772reedham-aws merged 5 commits intodevelopfrom
reedham-aws merged 5 commits intodevelopfrom
Conversation
* feat: add build_client * feat: add --use-buildkit option * feat: use build client when building with images * lint and format * feat: add command to cli * fix: use absolute path for dockerfile * test: add unit test for build_client * test: add unit test for build_context * fix: additional test fixes * fix: schema update * fix: remove hardcoded unix pathseps * fix: remove provenance and sbom from docker buildx * fix: refactor code to use SDKBuildClient This change also refactors a lot of docker specific things to be "container_client" rather than "docker_client". In addition, moving from instantiating the image build client in build context to lazily doing it in the app builder. * test: add additional unit tests * fix: fix error handling in CLIBuildClient * fix: reorder error handling in CLIImageBuilder
* test: add basic integration test * test: more comprehensive integ tests * test: add arm64 test and mark as tier1 * fix: update dockerfile error messages * test: remove arm64 test * fix: allow finch without sudo
bnusunny
approved these changes
Mar 10, 2026
valerena
approved these changes
Mar 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is to merge the feature branch
feat-buildkitto develop. Previously on that branch, we had approved the implmentation (#8661) and integration tests(#8689)Which issue(s) does this change fix?
This PR will resolve (once released in 1.156.0) #3972 by adding support for using the Docker CLI directly.
Why is this change necessary?
Previously SAM CLI only used the docker-py SDK, which does not offer support for the BuildKit plugin. BuildKit offers support for different features like parallel builds for multi-stage builds, better cross-architecture builds, and efficient caching.
How does it address the issue?
Adds support to use the
docker buildxandfinchCLIs, which both natively support BuildKit. The feature is used like:What side effects does this change have?
Should be none, as this is an opt-in feature.
Mandatory Checklist
PRs will only be reviewed after checklist is complete
make prpassesmake update-reproducible-reqsif dependencies were changedBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.