A simple bash script should work.
Example of code:
docker stats CONTAINER_ID --no-stream --format "{{.Container}}: {{.MemUsage}}"
However that code seems quite slow to get the response (at least on my MacOS M1).
I should check for another bash alternative...