LCOW: Pass platform through into layer store

Signed-off-by: John Howard <jhoward@microsoft.com>
This commit is contained in:
John Howard
2017-04-25 16:45:42 -07:00
parent fc21bf280b
commit 42c5c1a9ec
18 changed files with 125 additions and 74 deletions

View File

@@ -160,6 +160,7 @@ func (daemon *Daemon) Commit(name string, c *backend.ContainerCommitConfig) (str
}()
var parent *image.Image
os := runtime.GOOS
if container.ImageID == "" {
parent = new(image.Image)
parent.RootFS = image.NewRootFS()
@@ -168,9 +169,13 @@ func (daemon *Daemon) Commit(name string, c *backend.ContainerCommitConfig) (str
if err != nil {
return "", err
}
// To support LCOW, Windows needs to pass the platform in when registering the layer in the store
if runtime.GOOS == "windows" {
os = parent.OS
}
}
l, err := daemon.layerStore.Register(rwTar, parent.RootFS.ChainID())
l, err := daemon.layerStore.Register(rwTar, parent.RootFS.ChainID(), layer.Platform(os))
if err != nil {
return "", err
}