How do I list all containers in a user-defined docker network?

后端 未结 6 1666
刺人心
刺人心 2021-02-04 08:12

How do I get a list of all the containers in a user-defined docker network?

I would like to get all the commit hashes of every container for a specific user-defined dock

6条回答
  •  南笙
    南笙 (楼主)
    2021-02-04 08:35

    A simple command to list the names of the container using a custom network is:

    docker inspect network-name | grep Name
    

    This command will list the name of the network and containers connected to it like below:

    "Name": "network-name",
            "Name": "Container1",
            "Name": "Container2",
    

提交回复
热议问题