mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
use cached images instead of fetching the same image again
Docker-DCO-1.1-Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com> (github: dqminh)
This commit is contained in:
parent
3aae63f452
commit
a2a50aa35a
1 changed files with 3 additions and 3 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue