mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
In docker ps
, sort by port instead of unsorted.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <erik@hollensbe.org> (github: erikh)
This commit is contained in:
parent
7a7126faf6
commit
e32965dbb1
1 changed files with 2 additions and 0 deletions
|
@ -25,6 +25,8 @@ func ValidateHost(val string) (string, error) {
|
||||||
//TODO remove, used on < 1.5 in getContainersJSON
|
//TODO remove, used on < 1.5 in getContainersJSON
|
||||||
func displayablePorts(ports *engine.Table) string {
|
func displayablePorts(ports *engine.Table) string {
|
||||||
result := []string{}
|
result := []string{}
|
||||||
|
ports.SetKey("PublicPort")
|
||||||
|
ports.Sort()
|
||||||
for _, port := range ports.Data {
|
for _, port := range ports.Data {
|
||||||
if port.Get("IP") == "" {
|
if port.Get("IP") == "" {
|
||||||
result = append(result, fmt.Sprintf("%d/%s", port.GetInt("PublicPort"), port.Get("Type")))
|
result = append(result, fmt.Sprintf("%d/%s", port.GetInt("PublicPort"), port.Get("Type")))
|
||||||
|
|
Loading…
Reference in a new issue