Show container names and addresses on a Docker network
Build a paste-ready command, then review its compatibility and effects before running it.
docker network inspect <network> --format '{{range $id, $c := .Containers}}{{$c.Name}}\t{{$c.IPv4Address}}\t{{$c.MacAddress}}<println><end>'Complete required fields to copy the generated command.
read-onlyno known side effects Compatibility
Linux + macOS + WindowsVerified for Linux, macOS, Windows using bash, zsh, powershell syntax.
Operational knowledgereview due 2027-01-19
Requirementsdockerdocker must be installed and available on PATH.
Version supportdocker Current supported releasesVerified for linux, macos, windows using bash, zsh, powershell syntax; consult compatibility notes for platform-specific differences.
Expected signalsapi 172.22.0.4/16 02:42:ac:16:00:04Representative successful output; values vary with the selected target and system state.
Known errorsdocker: command not founddocker is missing or is not available on PATH.
Verifydocker network inspect {{network}} --format '{{range $id, $c := .Containers}}{{$c.Name}}\t{{$c.IPv4Address}}\t{{$c.MacAddress}}{{println}}{{end}}'The output matches the expected target and exits without an error.Rollback noteNot required: this command is read-only and does not change system state.
Command breakdown
01dockerCommandRuns the docker stage of this one-liner.
02networkArgumentPasses network to docker.
03inspectArgumentPasses inspect to docker.
04<network>ParameterA value supplied in the Fill parameters section.
05--formatOptionFormats each result using the supplied template.
06'{{range $id, $c := .Containers}}{{$c.Name}}\t{{$c.IPv4Address}}\t{{$c.MacAddress}}<println><end>'ParameterA value supplied in the Fill parameters section.
This advanced community-curated one-liner combines several stages. Review every option and placeholder before running it.
Example input
docker network inspect app_default --format '{{range $id, $c := .Containers}}{{$c.Name}}\t{{$c.IPv4Address}}\t{{$c.MacAddress}}{{println}}{{end}}'
Example output
api 172.22.0.4/16 02:42:ac:16:00:04
postgres 172.22.0.2/16 02:42:ac:16:00:02
Illustrative output — exact values vary by system and data.
Official sources