LCOW: Fix ImageCache to address right store

Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: ba40132366e196c740cdf2d2f1cbee7ead955d2f
Component: engine
This commit is contained in:
John Howard
2017-06-20 19:49:53 -07:00
parent 30a1a8646e
commit ebc74326cd
6 changed files with 13 additions and 17 deletions
+3 -7
View File
@@ -1,22 +1,18 @@
package daemon
import (
"runtime"
"github.com/Sirupsen/logrus"
"github.com/docker/docker/builder"
"github.com/docker/docker/image/cache"
)
// MakeImageCache creates a stateful image cache.
func (daemon *Daemon) MakeImageCache(sourceRefs []string) builder.ImageCache {
func (daemon *Daemon) MakeImageCache(sourceRefs []string, platform string) builder.ImageCache {
if len(sourceRefs) == 0 {
// TODO @jhowardmsft LCOW. For now, assume it is the OS of the host
return cache.NewLocal(daemon.stores[runtime.GOOS].imageStore)
return cache.NewLocal(daemon.stores[platform].imageStore)
}
// TODO @jhowardmsft LCOW. For now, assume it is the OS of the host
cache := cache.New(daemon.stores[runtime.GOOS].imageStore)
cache := cache.New(daemon.stores[platform].imageStore)
for _, ref := range sourceRefs {
img, err := daemon.GetImage(ref)