mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #17671 from Microsoft/sjw/skip_mount_on_create
Optimize Create Container to skip extra mount on Windows.
This commit is contained in:
commit
bb9eca9036
2 changed files with 5 additions and 4 deletions
|
@ -100,10 +100,6 @@ func (daemon *Daemon) create(params *ContainerCreateConfig) (retC *Container, re
|
|||
}
|
||||
}
|
||||
}()
|
||||
if err := daemon.Mount(container); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer daemon.Unmount(container)
|
||||
|
||||
if err := daemon.createContainerPlatformSpecificSettings(container, params.Config, params.HostConfig, img); err != nil {
|
||||
return nil, err
|
||||
|
|
|
@ -16,6 +16,11 @@ import (
|
|||
|
||||
// createContainerPlatformSpecificSettings performs platform specific container create functionality
|
||||
func (daemon *Daemon) createContainerPlatformSpecificSettings(container *Container, config *runconfig.Config, hostConfig *runconfig.HostConfig, img *image.Image) error {
|
||||
if err := daemon.Mount(container); err != nil {
|
||||
return err
|
||||
}
|
||||
defer daemon.Unmount(container)
|
||||
|
||||
for spec := range config.Volumes {
|
||||
name := stringid.GenerateNonCryptoID()
|
||||
destination := filepath.Clean(spec)
|
||||
|
|
Loading…
Add table
Reference in a new issue