Open champialex opened 3 months ago
open to a pr for this!
please note that def get_exposed_port(self, port: str): ...
is probably wrong as it uses
mapped_port = self.get_docker_client().port(self._container.id, port)
->
port_mappings = self.client.api.port(container_id, port)
->
def port(self, container, private_port):
"""
Lookup the public-facing port that is NAT-ed to ``private_port``.
Identical to the ``docker port`` command.
Args:
container (str): The container to look up
private_port (int): The private port to inspect
So the docker API expect it to be an int
with_bind_ports
& with_exposed_ports
seems safe
Opened #690
I'm trying to bind udp ports:
It works fine, except that ports are type hinted as
int
, leading to sad squiggly lines in IDEs.Could we change type hints of port APIs to allow strings, to make it nicer to define more fine grain port specs?