From 8451a08ed52b976fffb0cf34be0a48dcc36bdcbe Mon Sep 17 00:00:00 2001 From: Kenfe-Mickael Laventure Date: Wed, 16 Mar 2016 14:10:16 -0700 Subject: [PATCH] Update filter volume to allow filtering by bind mount source Signed-off-by: Kenfe-Mickael Laventure --- daemon/list.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/daemon/list.go b/daemon/list.go index 3bc819a79f..8f0a50de66 100644 --- a/daemon/list.go +++ b/daemon/list.go @@ -328,7 +328,11 @@ func includeContainerInList(container *container.Container, ctx *listContext) it if ctx.filters.Include("volume") { volumesByName := make(map[string]*volume.MountPoint) for _, m := range container.MountPoints { - volumesByName[m.Name] = m + if m.Name != "" { + volumesByName[m.Name] = m + } else { + volumesByName[m.Source] = m + } } volumeExist := fmt.Errorf("volume mounted in container")