Linux/Docker/Variables & Snippets: Difference between revisions
Appearance
No edit summary |
mNo edit summary |
||
Line 1: | Line 1: | ||
== List all containers and sort by memory consumption == | |||
<pre> | |||
docker stats --no-stream | tail -n +2 | sort -k 4 -h -r | |||
</pre> | |||
== Docker Host IP == | == Docker Host IP == | ||
<pre> | <pre> |
Revision as of 09:19, 6 January 2025
List all containers and sort by memory consumption
docker stats --no-stream | tail -n +2 | sort -k 4 -h -r
Docker Host IP
ip -4 route list match 0/0 | cut -d' ' -f3
List all container IPs
docker ps -q | xargs -n 1 docker inspect --format '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}} {{ .Name }}' | sed 's/ \// /'