You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to test a DNS server I build and for this to work I need to forward upd ports from inside the container to my host system.
The docker cli syntax to forward udp ports is -p 5353:53/udp. Currently, this is not possible with testcontainer, because Port is defined as:
I'm willing to provide a PR for this, but I think we should discuss possible implementations first, because it will most probably result in a breaking change.
The text was updated successfully, but these errors were encountered:
Minimizing breaking changes is obviously nice but I wouldn't worry about it too much. The primary interface that consumers interact with is Container#get_host_port.
If we first deprecate that one in favor of one that takes the protocol into account somehow, consumers should have a reasonable easy way to upgrade. Feel free to making breaking changes on Port and all the machinery around it!
I am also happy to review a PoC PR that doesn't fully work yet but only outlines the idea :)
After looking up the Docker docs I realized that the -p option also allows to bind against a specific host address. Should we take this into account for this PR, too?
After looking up the Docker docs I realized that the -p option also allows to bind against a specific host address. Should we take this into account for this PR, too?
I think for now we should be fine with no caring about specific hosts. Limiting the port to a specific host seems to be more of a feature that is used when running containers in production somewhere and hence is rather of small relevance for testcontainers.
The PortMapping idea sounds good. Would you be willing to put up a draft PR so we can see how it pans out?
I'm trying to test a DNS server I build and for this to work I need to forward
upd
ports from inside the container to my host system.The docker cli syntax to forward udp ports is
-p 5353:53/udp
. Currently, this is not possible with testcontainer, becausePort
is defined as:I'm willing to provide a PR for this, but I think we should discuss possible implementations first, because it will most probably result in a breaking change.
The text was updated successfully, but these errors were encountered: