From a2a50aa35ab58f52b68a65acfe668c26b765608f Mon Sep 17 00:00:00 2001 From: "Daniel, Dao Quang Minh" Date: Tue, 11 Nov 2014 15:15:00 -0500 Subject: [PATCH] use cached images instead of fetching the same image again Docker-DCO-1.1-Signed-off-by: Daniel, Dao Quang Minh (github: dqminh) --- daemon/daemon.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/daemon/daemon.go b/daemon/daemon.go index b0feae917b..39e816c52b 100644 --- a/daemon/daemon.go +++ b/daemon/daemon.go @@ -1090,9 +1090,9 @@ func (daemon *Daemon) ImageGetCached(imgID string, config *runconfig.Config) (*i // Loop on the children of the given image and check the config var match *image.Image for elem := range imageMap[imgID] { - img, err := daemon.Graph().Get(elem) - if err != nil { - return nil, err + img, ok := images[elem] + if !ok { + return nil, fmt.Errorf("unable to find image %q", elem) } if runconfig.Compare(&img.ContainerConfig, config) { if match == nil || match.Created.Before(img.Created) {