From e32965dbb13973f61ba1c0496c8136cc8c9273a2 Mon Sep 17 00:00:00 2001 From: Erik Hollensbe Date: Sun, 16 Mar 2014 16:28:13 +0000 Subject: [PATCH] In `docker ps`, sort by port instead of unsorted. Docker-DCO-1.1-Signed-off-by: Erik Hollensbe (github: erikh) --- api/common.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/api/common.go b/api/common.go index 10e7ddb4ae..5e5d2c5767 100644 --- a/api/common.go +++ b/api/common.go @@ -25,6 +25,8 @@ func ValidateHost(val string) (string, error) { //TODO remove, used on < 1.5 in getContainersJSON func displayablePorts(ports *engine.Table) string { result := []string{} + ports.SetKey("PublicPort") + ports.Sort() for _, port := range ports.Data { if port.Get("IP") == "" { result = append(result, fmt.Sprintf("%d/%s", port.GetInt("PublicPort"), port.Get("Type")))