We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
len()
1 parent 75a5713 commit c409383Copy full SHA for c409383
1 file changed
cli/command/container/port.go
@@ -68,7 +68,7 @@ func runPort(ctx context.Context, dockerCli command.Cli, opts *portOptions) erro
68
return errors.Wrapf(err, "Error: invalid port (%s)", port)
69
}
70
frontends, exists := c.NetworkSettings.Ports[nat.Port(port+"/"+proto)]
71
- if !exists || frontends == nil {
+ if !exists || len(frontends) == 0 {
72
return errors.Errorf("Error: No public port '%s' published for %s", opts.port, opts.container)
73
74
for _, frontend := range frontends {
0 commit comments