pull/7973/head
Sharif Elgamal 2020-05-20 14:41:15 -07:00
parent 43d37ec9f3
commit 3caad25d0e
1 changed files with 3 additions and 0 deletions

View File

@ -106,6 +106,9 @@ func ForwardedPort(ociBin string, ociID string, contPort int) (int, error) {
} else {
rr, err = runCmd(exec.Command(ociBin, "inspect", ociID))
fmt.Println(rr.Stdout.String())
if err != nil {
fmt.Println(err.Error())
}
rr, err = runCmd(exec.Command(ociBin, "inspect", "-f", fmt.Sprintf("'{{(index (index .NetworkSettings.Ports \"%d/tcp\") 0).HostPort}}'", contPort), ociID))
if err != nil {
return 0, errors.Wrapf(err, "get port %d for %q", contPort, ociID)