LCOW: commit to use image platform, not host

Signed-off-by: John Howard <jhoward@microsoft.com>
This commit is contained in:
John Howard 2017-05-17 12:01:43 -07:00
parent 3aa4a00715
commit 8f53780694
3 changed files with 4 additions and 4 deletions

View File

@ -84,7 +84,7 @@ func (b *Builder) exportImage(state *dispatchState, imageMount *imageMount, runC
ContainerConfig: runConfig, ContainerConfig: runConfig,
DiffID: newLayer.DiffID(), DiffID: newLayer.DiffID(),
Config: copyRunConfig(state.runConfig), Config: copyRunConfig(state.runConfig),
}) }, parentImage.OS)
// TODO: it seems strange to marshal this here instead of just passing in the // TODO: it seems strange to marshal this here instead of just passing in the
// image struct // image struct

View File

@ -188,7 +188,7 @@ func (daemon *Daemon) Commit(name string, c *backend.ContainerCommitConfig) (str
Config: newConfig, Config: newConfig,
DiffID: l.DiffID(), DiffID: l.DiffID(),
} }
config, err := json.Marshal(image.NewChildImage(parent, cc)) config, err := json.Marshal(image.NewChildImage(parent, cc, container.Platform))
if err != nil { if err != nil {
return "", err return "", err
} }

View File

@ -135,7 +135,7 @@ type ChildConfig struct {
} }
// NewChildImage creates a new Image as a child of this image. // NewChildImage creates a new Image as a child of this image.
func NewChildImage(img *Image, child ChildConfig) *Image { func NewChildImage(img *Image, child ChildConfig, platform string) *Image {
isEmptyLayer := layer.IsEmpty(child.DiffID) isEmptyLayer := layer.IsEmpty(child.DiffID)
rootFS := img.RootFS rootFS := img.RootFS
if rootFS == nil { if rootFS == nil {
@ -155,7 +155,7 @@ func NewChildImage(img *Image, child ChildConfig) *Image {
DockerVersion: dockerversion.Version, DockerVersion: dockerversion.Version,
Config: child.Config, Config: child.Config,
Architecture: runtime.GOARCH, Architecture: runtime.GOARCH,
OS: runtime.GOOS, OS: platform,
Container: child.ContainerID, Container: child.ContainerID,
ContainerConfig: *child.ContainerConfig, ContainerConfig: *child.ContainerConfig,
Author: child.Author, Author: child.Author,