Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions localstack-typedb/localstack_typedb/utils/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import requests

from localstack import config
from localstack.config import is_env_true
from localstack_typedb.utils.h2_proxy import apply_http2_patches_for_grpc_support
from localstack.utils.docker_utils import DOCKER_CLIENT
from localstack.extensions.api import Extension, http
Expand Down Expand Up @@ -106,14 +107,20 @@ def start_container(self) -> None:
if self.command:
kwargs["command"] = self.command

DOCKER_CLIENT.run_container(
self.image_name,
detach=True,
remove=True,
name=container_name,
ports=ports,
**kwargs,
)
try:
DOCKER_CLIENT.run_container(
self.image_name,
detach=True,
remove=True,
name=container_name,
ports=ports,
**kwargs,
)
except Exception as e:
LOG.debug("Failed to start container %s: %s", container_name, e)
# allow running TypeDB in a local server in dev mode, if TYPEDB_DEV_MODE is enabled
if not is_env_true("TYPEDB_DEV_MODE"):
raise

main_port = self.container_ports[0]
container_host = get_addressable_container_host()
Expand Down