SwissLife-OSS/squadron

Allow multiple ports per container

Closed this issue · 3 comments

Is your feature request related to a problem? Please describe.
Docker allows you to spin up a container and expose multiple port settings on it. As far as I can see, the ContainerResourceBuilder only allows for one port to be mapped.
Concrete example where this is useful:
VerneMq Mqtt exposes port 1883 for connections, but also 8888 for exposing health checks and metrics.

Describe the solution you'd like
Allow multiple port mappings per container by adapting the api of ContainerResourceBuilder ports to the same approach as cmds, volumes and env vars.

Yes, today it's only possible to add one port mapping. I see the point that it could be usefull to expose multiple ports.
We'll check the option to allow to map multiple ports in a future release.

I added a PR, that adds this feature:
#88

PR merged into master