Is there a way to display the docker stats sorted by memory usage of the containers?
I am using the following command to display the container with their names and I
Make sure your locale's decimal seperator is a DOT. If it is different sorting won't work.
That's why I use this command (Linux), note the LC_ALL=en_US.utf8:
LC_ALL=en_US.utf8
docker stats --no-stream --format "table {{.Name}}\t{{.Container}}\t{{.CPUPerc}}\t{{.MemUsage}}" | LC_ALL=en_US.utf8 sort -k 4 -h