@@ -160,26 +160,21 @@ func (daemon *Daemon) Commit(name string, c *backend.ContainerCommitConfig) (str
160160 }()
161161
162162 var parent * image.Image
163- os := runtime .GOOS
164163 if container .ImageID == "" {
165164 parent = new (image.Image )
166165 parent .RootFS = image .NewRootFS ()
167166 } else {
168- parent , err = daemon .imageStore .Get (container .ImageID )
167+ parent , err = daemon .stores [ container . Platform ]. imageStore .Get (container .ImageID )
169168 if err != nil {
170169 return "" , err
171170 }
172- // To support LCOW, Windows needs to pass the platform in when registering the layer in the store
173- if runtime .GOOS == "windows" {
174- os = parent .OS
175- }
176171 }
177172
178- l , err := daemon .layerStore .Register (rwTar , parent . RootFS . ChainID (), layer .Platform (os ))
173+ l , err := daemon .stores [ container . Platform ]. layerStore .Register (rwTar , rootFS . ChainID (), layer .Platform (container . Platform ))
179174 if err != nil {
180175 return "" , err
181176 }
182- defer layer .ReleaseAndLog (daemon .layerStore , l )
177+ defer layer .ReleaseAndLog (daemon .stores [ container . Platform ]. layerStore , l )
183178
184179 containerConfig := c .ContainerConfig
185180 if containerConfig == nil {
@@ -198,13 +193,13 @@ func (daemon *Daemon) Commit(name string, c *backend.ContainerCommitConfig) (str
198193 return "" , err
199194 }
200195
201- id , err := daemon .imageStore .Create (config )
196+ id , err := daemon .stores [ container . Platform ]. imageStore .Create (config )
202197 if err != nil {
203198 return "" , err
204199 }
205200
206201 if container .ImageID != "" {
207- if err := daemon .imageStore .SetParent (id , container .ImageID ); err != nil {
202+ if err := daemon .stores [ container . Platform ]. imageStore .SetParent (id , container .ImageID ); err != nil {
208203 return "" , err
209204 }
210205 }
@@ -223,7 +218,7 @@ func (daemon *Daemon) Commit(name string, c *backend.ContainerCommitConfig) (str
223218 return "" , err
224219 }
225220 }
226- if err := daemon .TagImageWithReference (id , newTag ); err != nil {
221+ if err := daemon .TagImageWithReference (id , container . Platform , newTag ); err != nil {
227222 return "" , err
228223 }
229224 imageRef = reference .FamiliarString (newTag )
0 commit comments