User Tools

Site Tools


wiki:docker_commands

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
wiki:docker_commands [2024/01/08 13:53] – [Remove images older than 2 weeks] antisawiki:docker_commands [2026/05/21 12:10] (current) – add Get IPs of all containers antisa
Line 16: Line 16:
  
   docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' <container-name>   docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' <container-name>
 +
 +===== Get IPs of all containers with names =====
 +  docker inspect -f '{{.Name }}            {{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps -aq)
  
 ===== Run kibana ===== ===== Run kibana =====
Line 46: Line 49:
  
 The second command removes dangling build cache which will reclaim the disk space after image deletion. The second command removes dangling build cache which will reclaim the disk space after image deletion.
 +
 +===== Print IPs for all containers =====
 +
 +  docker ps -a --format "table {{.ID}}\t{{.Names}}\t{{.Image}}" \
 +  | tail -n +2 \
 +  | while read -r id name image; do
 +    ip=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' "$id")
 +    printf "%-12s\t%-30s\t%-20s\t%s\n" "$id" "$name" "$image" "${ip:-<no‑IP>}"
 +  done
 +
wiki/docker_commands.1704721991.txt.gz · Last modified: by antisa

Except where otherwise noted, content on this wiki is licensed under the following license: CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki