mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
LCOW: Pass platform through into layer store
Signed-off-by: John Howard <jhoward@microsoft.com>
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user