I'm trying to bind udp ports:
deftelegraf(network: Network):
ctr=DockerContainer(image="telegraf:1.31.1")
ctr.with_volume_mapping(f"{CURRENT_DIR}/telegraf_test.conf", "/etc/telegraf/telegraf.d/telegraf_test.conf")
ctr.with_exposed_ports("8094/tcp") # Telegraf portsctr.with_bind_ports("8125/udp", "8125/udp")
ctr.with_bind_ports("8092/udp", "8092/udp")
_connect_to_network(ctr, network, "telegraf")
returnctrIt 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?
defwith_bind_ports(self, container: str, host: Optional[str] =None): ...
defwith_exposed_ports(self, *ports: str): ...
defget_exposed_port(self, port: str): ...
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?