From c35bd74937ba7ad26b61f146702a7ff4b1a28411 Mon Sep 17 00:00:00 2001 From: David Tsulaia Date: Thu, 30 Oct 2025 20:58:18 +0400 Subject: [PATCH] feat: custom image name support for Docker builds --- samcli/lib/build/app_builder.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/samcli/lib/build/app_builder.py b/samcli/lib/build/app_builder.py index ed1ede172e..a01f164872 100644 --- a/samcli/lib/build/app_builder.py +++ b/samcli/lib/build/app_builder.py @@ -422,7 +422,8 @@ def _build_lambda_image(self, function_name: str, metadata: Dict, architecture: docker_context = cast(str, metadata.get("DockerContext")) # Have a default tag if not present. tag = metadata.get("DockerTag", "latest") - docker_tag = f"{function_name.lower()}:{tag}" + image_name = cast(str, metadata.get("DockerImage", function_name.lower())) + docker_tag = f"{image_name}:{tag}" docker_build_target = metadata.get("DockerBuildTarget", None) docker_build_args = metadata.get("DockerBuildArgs", {})