зеркало из https://github.com/microsoft/docker.git
Squashed commit of the following:
commit d379f7645026001ce57fd6421c819f6c7df77964 Author: Matthew Mayer <matthewkmayer@gmail.com> Date: Mon Mar 23 22:13:06 2015 -0700 Removes unused imports. Signed-off-by: Matthew Mayer <matthewkmayer@gmail.com> commit 6e1f77c7f1566c8719087d88fbe06bade122691c Author: Matthew Mayer <matthewkmayer@gmail.com> Date: Mon Mar 23 20:41:16 2015 -0700 Removes bind dir creation in daemon start. Signed-off-by: Matthew Mayer <matthewkmayer@gmail.com> Signed-off-by: Matthew Mayer <matthewkmayer@gmail.com>
This commit is contained in:
Родитель
3ebd768487
Коммит
08d75bc450
|
@ -1,10 +1,6 @@
|
|||
package daemon
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/docker/docker/engine"
|
||||
"github.com/docker/docker/runconfig"
|
||||
)
|
||||
|
@ -54,22 +50,6 @@ func (daemon *Daemon) setHostConfig(container *Container, hostConfig *runconfig.
|
|||
return err
|
||||
}
|
||||
|
||||
// FIXME: this should be handled by the volume subsystem
|
||||
// Validate the HostConfig binds. Make sure that:
|
||||
// the source exists
|
||||
for _, bind := range hostConfig.Binds {
|
||||
splitBind := strings.Split(bind, ":")
|
||||
source := splitBind[0]
|
||||
|
||||
// ensure the source exists on the host
|
||||
_, err := os.Stat(source)
|
||||
if err != nil && os.IsNotExist(err) {
|
||||
err = os.MkdirAll(source, 0755)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Could not create local directory '%s' for bind mount: %v!", source, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
// Register any links from the host config before starting the container
|
||||
if err := daemon.RegisterLinks(container, hostConfig); err != nil {
|
||||
return err
|
||||
|
|
Загрузка…
Ссылка в новой задаче