Decouple daemon and container to mount and unmount filesystems.

Side effects:
- Decouple daemon and container to start containers.
- Decouple daemon and container to copy files.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 3a497650464b40191bd2cde348e676acf4efe270
Component: engine
This commit is contained in:
David Calavera
2015-11-04 12:27:47 -05:00
parent 57930f801e
commit b52340d649
17 changed files with 188 additions and 176 deletions
@@ -96,7 +96,8 @@ func (d Docker) Create(cfg *runconfig.Config, hostCfg *runconfig.HostConfig) (*d
if err != nil {
return nil, ccr.Warnings, err
}
return container, ccr.Warnings, container.Mount()
return container, ccr.Warnings, d.Mount(container)
}
// Remove removes a container specified by `id`.
@@ -210,6 +211,21 @@ func (d Docker) Kill(container *daemon.Container) error {
return d.Daemon.Kill(container)
}
// Mount mounts the root filesystem for the container.
func (d Docker) Mount(c *daemon.Container) error {
return d.Daemon.Mount(c)
}
// Unmount unmounts the root filesystem for the container.
func (d Docker) Unmount(c *daemon.Container) error {
return d.Daemon.Unmount(c)
}
// Start starts a container
func (d Docker) Start(c *daemon.Container) error {
return d.Daemon.Start(c)
}
// Following is specific to builder contexts
// DetectContextFromRemoteURL returns a context and in certain cases the name of the dockerfile to be used