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

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

    You can list all networks with:

    docker network ls
    

    And inspect one network to see its hosts (containers)

    docker network inspect 
    

    You can see which networks a container is connected to inspecting that container:

    docker inspect 
    

    More info in the docs: https://docs.docker.com/engine/userguide/networking/work-with-networks/#create-networks

提交回复
热议问题