Filter containers that mount a specific volume or have a volume mounted in a specific path

docker ps

docker ps --filter="volume={{path/to/directory}}" --format "table {{.ID}}\t{{.Image}}\t{{.Names}}\t{{.Mounts}}"

click the source code to copy install docker ps on any operating system with command-not-found.com