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

后端 未结 6 1670
刺人心
刺人心 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:17

    Another way using pure bash and no python - easier to remember for me

    docker network inspect YOUR_NETWORK_ID | grep Name | tail -n +2 | cut -d':' -f2 | tr -d ',"'
    

    Sample output

    container1
    container2
    

提交回复
热议问题