зеркало из https://github.com/microsoft/docker.git
fix broken docker port
This commit is contained in:
Родитель
5a411fa38e
Коммит
affe7caf78
|
@ -574,8 +574,10 @@ func (cli *DockerCli) CmdPort(args ...string) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if frontend, exists := out.NetworkSettings.PortMapping[cmd.Arg(1)]; exists {
|
if frontend, exists := out.NetworkSettings.PortMapping["Tcp"][cmd.Arg(1)]; exists {
|
||||||
fmt.Fprintf(cli.out, "%s\n", frontend)
|
fmt.Fprintf(cli.out, "tcp: %s\n", frontend)
|
||||||
|
} else if frontend, exists := out.NetworkSettings.PortMapping["Udp"][cmd.Arg(1)]; exists {
|
||||||
|
fmt.Fprintf(cli.out, "udp: %s\n", frontend)
|
||||||
} else {
|
} else {
|
||||||
return fmt.Errorf("Error: No private port '%s' allocated on %s", cmd.Arg(1), cmd.Arg(0))
|
return fmt.Errorf("Error: No private port '%s' allocated on %s", cmd.Arg(1), cmd.Arg(0))
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче