Last active
January 22, 2023 04:36
-
-
Save michaellwest/51d4337e89f93a0c69a3ad3260071473 to your computer and use it in GitHub Desktop.
List Docker Container Name and IPAddress as a table using PowerShell.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker ps -q | ForEach-Object { "Name,IPAddress" } { $data = docker inspect $_ --format '{{json .Name}},{{range .NetworkSettings.Networks}}{{json .IPAddress}}{{end}}'; $data.replace('/','') } | ConvertFrom-Csv | |
<# | |
Name IPAddress | |
---- --------- | |
spe-traefik-1 172.31.127.71 | |
spe-cm-1 172.31.126.246 | |
spe-id-1 172.31.116.201 | |
spe-mssql-1 172.31.120.96 | |
spe-solr-1 172.31.121.74 | |
#> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment