summaryrefslogtreecommitdiff
path: root/cmd/podman/port.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/podman/port.go')
-rw-r--r--cmd/podman/port.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/cmd/podman/port.go b/cmd/podman/port.go
index 488ef2ffe..be84da065 100644
--- a/cmd/podman/port.go
+++ b/cmd/podman/port.go
@@ -34,12 +34,12 @@ var (
func init() {
portCommand.Command = _portCommand
+ portCommand.SetUsageTemplate(UsageTemplate())
flags := portCommand.Flags()
flags.BoolVarP(&portCommand.All, "all", "a", false, "Display port information for all containers")
flags.BoolVarP(&portCommand.Latest, "latest", "l", false, "Act on the latest container podman is aware of")
- rootCmd.AddCommand(portCommand.Command)
}
func portCmd(c *cliconfig.PortValues) error {
@@ -125,8 +125,13 @@ func portCmd(c *cliconfig.PortValues) error {
if c.All {
fmt.Println(con.ID())
}
+
+ portmappings, err := con.PortMappings()
+ if err != nil {
+ return err
+ }
// Iterate mappings
- for _, v := range con.Config().PortMappings {
+ for _, v := range portmappings {
hostIP := v.HostIP
// Set host IP to 0.0.0.0 if blank
if hostIP == "" {