health-check port discovery should be consistent with WAIT_FOR_SERVICE_TCP_PORT
What does this MR do?
This MR makes sure that health-check command port discovery uses lowest (sorted) number port from environment variables to be consistent with docker.go:addServiceHealthCheckEnvironment port detection where exposed ports are sorted in ascending order.
Why was this MR needed?
wait-for-service container constantly tried connecting to wrong (and probably random) port number from the last environment variable containing _TCP_PORT suffix.
What's the best way to test this MR?
Run rabbitmq:3
service container. Health check should succeed.