state.go 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. package specs
  2. // ContainerState represents the state of a container.
  3. type ContainerState string
  4. const (
  5. // StateCreating indicates that the container is being created
  6. StateCreating ContainerState = "creating"
  7. // StateCreated indicates that the runtime has finished the create operation
  8. StateCreated ContainerState = "created"
  9. // StateRunning indicates that the container process has executed the
  10. // user-specified program but has not exited
  11. StateRunning ContainerState = "running"
  12. // StateStopped indicates that the container process has exited
  13. StateStopped ContainerState = "stopped"
  14. )
  15. // State holds information about the runtime state of the container.
  16. type State struct {
  17. // Version is the version of the specification that is supported.
  18. Version string `json:"ociVersion"`
  19. // ID is the container ID
  20. ID string `json:"id"`
  21. // Status is the runtime status of the container.
  22. Status ContainerState `json:"status"`
  23. // Pid is the process ID for the container process.
  24. Pid int `json:"pid,omitempty"`
  25. // Bundle is the path to the container's bundle directory.
  26. Bundle string `json:"bundle"`
  27. // Annotations are key values associated with the container.
  28. Annotations map[string]string `json:"annotations,omitempty"`
  29. }