I haven\'t found any way to order my results when using docker ps
docker ps
In my case I want to order by .Ports
docker ps -a --format \"table {{.ID}}
If it's enough to simply sort by output column, you can use the following:
docker ps -a --format "table {{.ID}}\t{{.Names}}\t{{.Ports}}" | (read -r; printf "%s\n" "$REPLY"; sort -k 3 )
I also added a code for skipping the table headers and sorting only ps output data.