1

I was wondering if there is a docker command to list all the containers with their network? I know there is docker network inspect, but that's to inspect a network. I'm looking for a command that shows for all the containers to which network they are connected.

1 Answer 1

2

The data is within docker network inspect if you specify all of the networks as arguments, which can also be done programmatically. The line looks like this:

docker network inspect $(docker network ls -q)

The output is valid JSON, which can be modified to put in any format you need.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .