How to determine what containers use the docker volume?

后端 未结 2 1839
挽巷
挽巷 2021-01-31 07:20

Suppose I have a volume and I know its name or id.

I want to determine the list of containers (their names or ids) that use the volume.

What commands can I use t

2条回答
  •  鱼传尺愫
    2021-01-31 08:05

    docker ps can filter by volume to show all of the containers that mount a given volume:

    docker ps -a --filter volume=VOLUME_NAME_OR_MOUNT_POINT
    

    Reference: https://docs.docker.com/engine/reference/commandline/ps/#filtering

提交回复
热议问题