mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
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>
This commit is contained in:
@@ -29,15 +29,15 @@ func (daemon *Daemon) containerRestart(container *Container, seconds int) error
|
||||
// Avoid unnecessarily unmounting and then directly mounting
|
||||
// the container when the container stops and then starts
|
||||
// again
|
||||
if err := container.Mount(); err == nil {
|
||||
defer container.Unmount()
|
||||
if err := daemon.Mount(container); err == nil {
|
||||
defer daemon.Unmount(container)
|
||||
}
|
||||
|
||||
if err := daemon.containerStop(container, seconds); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := container.Start(); err != nil {
|
||||
if err := daemon.containerStart(container); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user