File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2323class Container :
2424 @staticmethod
2525 def create_localstack_container (
26- pull_new_image ,
27- image_name ,
28- image_tag ,
29- gateway_listen ,
30- environment_variables ,
26+ pull_new_image : bool ,
27+ image_name : str ,
28+ image_tag : str ,
29+ gateway_listen : str ,
30+ environment_variables : dict ,
31+ bind_ports : dict ,
3132 ):
3233 environment_variables = environment_variables or {}
3334 environment_variables ["GATEWAY_LISTEN" ] = gateway_listen
@@ -39,16 +40,17 @@ def create_localstack_container(
3940 else False
4041 )
4142
42- port = gateway_listen .split (":" )[1 ]
43- full_port_edge = {port : port }
43+ bind_ports = bind_ports or {}
44+ gateway_port = gateway_listen .split (":" )[1 ]
45+ bind_ports .update ({gateway_port : gateway_port })
4446
4547 if pull_new_image or not image_exists :
4648 logging .info ("Pulling latest image" )
4749 DOCKER_CLIENT .images .pull (image_name_or_default , image_tag )
4850
4951 return DOCKER_CLIENT .containers .run (
5052 image_name_or_default ,
51- ports = full_port_edge ,
53+ ports = bind_ports ,
5254 environment = environment_variables ,
5355 detach = True ,
5456 )
You can’t perform that action at this time.
0 commit comments