diff --git a/cli/command/network/list.go b/cli/command/network/list.go index 30c1e7d122..ad286190a4 100644 --- a/cli/command/network/list.go +++ b/cli/command/network/list.go @@ -10,6 +10,7 @@ import ( "github.com/docker/cli/opts" "github.com/docker/docker/api/types" "github.com/spf13/cobra" + "vbom.ml/util/sortorder" ) type listOptions struct { @@ -59,7 +60,7 @@ func runList(dockerCli command.Cli, options listOptions) error { } sort.Slice(networkResources, func(i, j int) bool { - return networkResources[i].Name < networkResources[j].Name + return sortorder.NaturalLess(networkResources[i].Name, networkResources[j].Name) }) networksCtx := formatter.Context{ diff --git a/cli/command/network/testdata/network-list-sort.golden b/cli/command/network/testdata/network-list-sort.golden index 434913823d..165f93953b 100644 --- a/cli/command/network/testdata/network-list-sort.golden +++ b/cli/command/network/testdata/network-list-sort.golden @@ -1,3 +1,3 @@ network-1-foo -network-10-foo network-2-foo +network-10-foo