diff --git a/libcontainer/container_linux.go b/libcontainer/container_linux.go index 9f2b48c4f..ec5ace55d 100644 --- a/libcontainer/container_linux.go +++ b/libcontainer/container_linux.go @@ -263,9 +263,6 @@ func (c *linuxContainer) start(process *Process, isInit bool) error { } // generate a timestamp indicating when the container was started c.created = time.Now().UTC() - c.state = &runningState{ - c: c, - } if isInit { c.state = &createdState{ c: c, @@ -292,6 +289,10 @@ func (c *linuxContainer) start(process *Process, isInit bool) error { } } } + } else { + c.state = &runningState{ + c: c, + } } return nil }