From 3329709c6bcea5aabfe60111d5e7c2682b9d9f00 Mon Sep 17 00:00:00 2001 From: Cristopher Pinzon Date: Wed, 25 Feb 2026 15:22:32 -0500 Subject: [PATCH 1/3] upgrade lib version --- README.md | 1 + localstack_utils/__init__.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2324d6d..b3cbf1d 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,7 @@ class TestKinesis(unittest.TestCase): ``` ## Change Log +* 1.0.4: Fixes to LocalStack and Container modules * 1.0.3: Add auto_remove config option * 1.0.2: LocalStack Pro image set as default * 1.0.1: Repository URL fixed diff --git a/localstack_utils/__init__.py b/localstack_utils/__init__.py index 976498a..92192ee 100644 --- a/localstack_utils/__init__.py +++ b/localstack_utils/__init__.py @@ -1 +1 @@ -__version__ = "1.0.3" +__version__ = "1.0.4" From 69334ec0cd6d72dcdf89dd1b63a44fbbe7000a5a Mon Sep 17 00:00:00 2001 From: Mark Heiges Date: Tue, 24 Mar 2026 12:51:23 -0400 Subject: [PATCH 2/3] configurable container name --- localstack_utils/container.py | 2 ++ localstack_utils/localstack.py | 5 +++++ localstack_utils/localstack_docker_configuration.py | 1 + 3 files changed, 8 insertions(+) diff --git a/localstack_utils/container.py b/localstack_utils/container.py index 3bd2890..b2a18c2 100644 --- a/localstack_utils/container.py +++ b/localstack_utils/container.py @@ -29,6 +29,7 @@ def create_localstack_container( pull_new_image: bool = False, image_name: str = LOCALSTACK_IMAGE_NAME, image_tag: str = LATEST_TAG, + container_name: str = DEFAULT_CONTAINER_ID, gateway_listen: str = "0.0.0.0:4566", auto_remove: bool = False, environment_variables: dict | None = None, @@ -52,6 +53,7 @@ def create_localstack_container( return DOCKER_CLIENT.containers.run( image_name, + name=container_name, ports=bind_ports, environment=environment_variables, auto_remove=auto_remove, diff --git a/localstack_utils/localstack.py b/localstack_utils/localstack.py index dd4985d..353aae4 100644 --- a/localstack_utils/localstack.py +++ b/localstack_utils/localstack.py @@ -43,6 +43,7 @@ def startup(self, docker_configuration): pull_new_image=docker_configuration.pull_new_image, image_name=docker_configuration.image_name, image_tag=docker_configuration.image_tag, + container_name=docker_configuration.container_name, gateway_listen=docker_configuration.gateway_listen, auto_remove=docker_configuration.auto_remove_container, environment_variables=docker_configuration.environment_variables, @@ -71,6 +72,7 @@ def setup_logger(self): def startup_localstack( image_name="", tag="", + container_name="", pro=False, ports=None, env_variables=None, @@ -89,6 +91,9 @@ def startup_localstack( if tag: config.image_tag = tag + if container_name: + config.container_name = container_name + if ports: config.port_mappings = ports diff --git a/localstack_utils/localstack_docker_configuration.py b/localstack_utils/localstack_docker_configuration.py index 5083c28..d1e332f 100644 --- a/localstack_utils/localstack_docker_configuration.py +++ b/localstack_utils/localstack_docker_configuration.py @@ -3,6 +3,7 @@ class LocalstackDockerConfiguration: randomize_ports = False image_name = None image_tag = None + container_name = None platform = None gateway_listen = "0.0.0.0:4566" From abe71eecdc301a4180f0e291c2b2d397c46491f9 Mon Sep 17 00:00:00 2001 From: Cristopher Pinzon Date: Thu, 30 Apr 2026 16:49:56 -0500 Subject: [PATCH 3/3] Release 1.0.5: configurable container name and auth token forwarding --- README.md | 1 + localstack_utils/__init__.py | 2 +- localstack_utils/container.py | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b3cbf1d..e8a9d85 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,7 @@ class TestKinesis(unittest.TestCase): ``` ## Change Log +* 1.0.5: Add support for configurable container name and auth token forwarding * 1.0.4: Fixes to LocalStack and Container modules * 1.0.3: Add auto_remove config option * 1.0.2: LocalStack Pro image set as default diff --git a/localstack_utils/__init__.py b/localstack_utils/__init__.py index 92192ee..68cdeee 100644 --- a/localstack_utils/__init__.py +++ b/localstack_utils/__init__.py @@ -1 +1 @@ -__version__ = "1.0.4" +__version__ = "1.0.5" diff --git a/localstack_utils/container.py b/localstack_utils/container.py index b2a18c2..8d96bb7 100644 --- a/localstack_utils/container.py +++ b/localstack_utils/container.py @@ -1,6 +1,7 @@ from __future__ import annotations import logging +import os import re import docker from time import sleep @@ -38,6 +39,8 @@ def create_localstack_container( ): environment_variables = environment_variables or {} environment_variables["GATEWAY_LISTEN"] = gateway_listen + if "LOCALSTACK_AUTH_TOKEN" not in environment_variables and os.environ.get("LOCALSTACK_AUTH_TOKEN"): + environment_variables["LOCALSTACK_AUTH_TOKEN"] = os.environ["LOCALSTACK_AUTH_TOKEN"] image_exists = ( True if len(DOCKER_CLIENT.images.list(name=image_name)) else False