GetPublishedPort returns the published port for a given private port.
(privatePort uint16, c container.Summary)
| 561 | |
| 562 | // GetPublishedPort returns the published port for a given private port. |
| 563 | func GetPublishedPort(privatePort uint16, c container.Summary) int { |
| 564 | for _, port := range c.Ports { |
| 565 | if port.PrivatePort == privatePort { |
| 566 | return int(port.PublicPort) |
| 567 | } |
| 568 | } |
| 569 | return 0 |
| 570 | } |
| 571 | |
| 572 | // RunSimpleContainer runs a container (non-daemonized) and captures the stdout/stderr. |
| 573 | // It will block, so not to be run on a container whose entrypoint or cmd might hang or run too long. |
no outgoing calls
no test coverage detected