mirror of https://github.com/docker/docs.git
Merge pull request #2662 from dotcloud/do_not_cleanup_start_if_running
on docker start, do not cleanup if already running
This commit is contained in:
commit
71c05bb87c
|
@ -702,15 +702,14 @@ func (container *Container) Attach(stdin io.ReadCloser, stdinCloser io.Closer, s
|
||||||
func (container *Container) Start() (err error) {
|
func (container *Container) Start() (err error) {
|
||||||
container.State.Lock()
|
container.State.Lock()
|
||||||
defer container.State.Unlock()
|
defer container.State.Unlock()
|
||||||
|
if container.State.Running {
|
||||||
|
return fmt.Errorf("The container %s is already running.", container.ID)
|
||||||
|
}
|
||||||
defer func() {
|
defer func() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
container.cleanup()
|
container.cleanup()
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
if container.State.Running {
|
|
||||||
return fmt.Errorf("The container %s is already running.", container.ID)
|
|
||||||
}
|
|
||||||
if err := container.EnsureMounted(); err != nil {
|
if err := container.EnsureMounted(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue