Docker-DCO-1.1-Signed-off-by: Tibor Vass <teabee89@gmail.com> (github: tiborvass) Upstream-commit: 262d45e0fe483dbc6d27bc6af51590a8be42d55f Component: engine
23 lines
424 B
Go
23 lines
424 B
Go
package native
|
|
|
|
import (
|
|
"path/filepath"
|
|
|
|
"github.com/docker/libcontainer"
|
|
)
|
|
|
|
type info struct {
|
|
ID string
|
|
driver *driver
|
|
}
|
|
|
|
// IsRunning is determined by looking for the
|
|
// pid file for a container. If the file exists then the
|
|
// container is currently running
|
|
func (i *info) IsRunning() bool {
|
|
if _, err := libcontainer.GetState(filepath.Join(i.driver.root, i.ID)); err == nil {
|
|
return true
|
|
}
|
|
return false
|
|
}
|