Make `ps` order predictable
so one can run `watch docker ecs compose ps`
@@ -4,6 +4,7 @@ import (
"context"
"fmt"
"os"
+ "sort"
"strings"
"text/tabwriter"
@@ -43,6 +44,10 @@ func (c *client) ComposePs(ctx context.Context, project *compose.Project) error
return err
}
+ sort.Slice(tasks, func(i, j int) bool {
+ return strings.Compare(tasks[i].Service, tasks[j].Service) < 0
+ })
+
for _, t := range tasks {
ports := []string{}
s, err := project.GetService(t.Service)
