puppetlabs / provision

Simple tasks to provision and tear_down containers / instances and virtual machines.
Apache License 2.0
20 stars 53 forks source link

Docker SSH forwarding port allocations #183

Closed hsnodgrass closed 2 years ago

hsnodgrass commented 2 years ago

This changes how SSH forwarding ports are allocated when provisioning a Docker container. This changes port allocation to pick an arbitrary port number at random from the ephemeral port range, tests to see if the port is in use or not with a socket connection, and assigns the port if it is not in use.

This change allows for a large amount of containers to be provisioned as opposed to the 8 allowed beforehand due to the hard-coded port range. Additionally, this change moves the ports used from the well-known range to the ephemeral range reducing the potential for port conflicts.

CLAassistant commented 2 years ago

CLA assistant check
All committers have signed the CLA.