@@ -38,26 +38,21 @@ def startup(self, docker_configuration):
3838 if self .locked :
3939 raise Exception ("A docker instance is starting or already started." )
4040 self .locked = True
41- self .external_hostname = docker_configuration .external_hostname
4241
4342 try :
4443 self .localstack_container = Container .create_localstack_container (
45- docker_configuration .external_hostname ,
4644 docker_configuration .pull_new_image ,
47- docker_configuration .randomize_ports ,
4845 docker_configuration .image_name ,
4946 docker_configuration .image_tag ,
50- docker_configuration .port_edge ,
51- docker_configuration .port_elastic_search ,
47+ docker_configuration .gateway_listen ,
5248 docker_configuration .environment_variables ,
5349 docker_configuration .port_mappings ,
54- docker_configuration .bind_mounts ,
55- docker_configuration .platform ,
50+ docker_configuration .pro ,
5651 )
5752
5853 self .setup_logger ()
5954
60- Container .waitForReady (self .localstack_container , READY_TOKEN )
55+ Container .wait_for_ready (self .localstack_container , READY_TOKEN )
6156
6257 except docker .errors .APIError :
6358 if not docker_configuration .ignore_docker_runerrors :
@@ -74,16 +69,37 @@ def setup_logger(self):
7469 localstack_logger .start ()
7570
7671
77- def startup_localstack (port = 4566 , services = [], ignore_docker_errors = False ):
72+ def startup_localstack (
73+ image_name = "" ,
74+ tag = "" ,
75+ pro = False ,
76+ ports = None ,
77+ env_variables = None ,
78+ gateway_listen = "" ,
79+ ignore_docker_errors = False ,
80+ ):
7881 global localstack_instance
7982 localstack_instance = Localstack .INSTANCE ()
8083 config = LocalstackDockerConfiguration ()
8184
82- if len (services ):
83- config .envirement_variables .update ({"SERVICES" : "," .join (services )})
84- if port != 4566 :
85- config .port_edge = str (port )
8685 config .ignore_docker_runerrors = ignore_docker_errors
86+ if image_name :
87+ config .image_name = image_name
88+
89+ if tag :
90+ config .image_tag = tag
91+
92+ if ports :
93+ config .port_mappings = ports
94+
95+ if pro :
96+ config .pro = pro
97+
98+ if env_variables :
99+ config .environment_variables = env_variables
100+
101+ if gateway_listen :
102+ config .gateway_listen = gateway_listen
87103
88104 localstack_instance .startup (config )
89105
0 commit comments