Optimize Create Container to skip extra mount on Windows.
| ... | ... |
@@ -100,10 +100,6 @@ func (daemon *Daemon) create(params *ContainerCreateConfig) (retC *Container, re |
| 100 | 100 |
} |
| 101 | 101 |
} |
| 102 | 102 |
}() |
| 103 |
- if err := daemon.Mount(container); err != nil {
|
|
| 104 |
- return nil, err |
|
| 105 |
- } |
|
| 106 |
- defer daemon.Unmount(container) |
|
| 107 | 103 |
|
| 108 | 104 |
if err := daemon.createContainerPlatformSpecificSettings(container, params.Config, params.HostConfig, img); err != nil {
|
| 109 | 105 |
return nil, err |
| ... | ... |
@@ -16,6 +16,11 @@ import ( |
| 16 | 16 |
|
| 17 | 17 |
// createContainerPlatformSpecificSettings performs platform specific container create functionality |
| 18 | 18 |
func (daemon *Daemon) createContainerPlatformSpecificSettings(container *Container, config *runconfig.Config, hostConfig *runconfig.HostConfig, img *image.Image) error {
|
| 19 |
+ if err := daemon.Mount(container); err != nil {
|
|
| 20 |
+ return err |
|
| 21 |
+ } |
|
| 22 |
+ defer daemon.Unmount(container) |
|
| 23 |
+ |
|
| 19 | 24 |
for spec := range config.Volumes {
|
| 20 | 25 |
name := stringid.GenerateNonCryptoID() |
| 21 | 26 |
destination := filepath.Clean(spec) |