mirror of
https://github.com/docker/compose.git
synced 2026-08-27 03:45:29 +00:00
Add Restart Policy support when running single container
This commit is contained in:
parent
2c4be4f7e3
commit
a2c2d6aa5d
12 changed files with 189 additions and 48 deletions
|
|
@ -25,19 +25,20 @@ import (
|
|||
|
||||
// Container represents a created container
|
||||
type Container struct {
|
||||
ID string
|
||||
Status string
|
||||
Image string
|
||||
Command string
|
||||
CPUTime uint64
|
||||
CPULimit float64
|
||||
MemoryUsage uint64
|
||||
MemoryLimit uint64
|
||||
PidsCurrent uint64
|
||||
PidsLimit uint64
|
||||
Labels []string
|
||||
Ports []Port
|
||||
Platform string
|
||||
ID string
|
||||
Status string
|
||||
Image string
|
||||
Command string
|
||||
CPUTime uint64
|
||||
CPULimit float64
|
||||
MemoryUsage uint64
|
||||
MemoryLimit uint64
|
||||
PidsCurrent uint64
|
||||
PidsLimit uint64
|
||||
Labels []string
|
||||
Ports []Port
|
||||
Platform string
|
||||
RestartPolicyCondition string
|
||||
}
|
||||
|
||||
// Port represents a published port of a container
|
||||
|
|
@ -70,6 +71,8 @@ type ContainerConfig struct {
|
|||
CPULimit float64
|
||||
// Environment variables
|
||||
Environment []string
|
||||
// Restart policy condition
|
||||
RestartPolicyCondition string
|
||||
}
|
||||
|
||||
// ExecRequest contaiens configuration about an exec request
|
||||
|
|
|
|||
11
containers/types.go
Normal file
11
containers/types.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
package containers
|
||||
|
||||
const (
|
||||
// RestartPolicyAny Always restarts
|
||||
RestartPolicyAny = "any"
|
||||
// RestartPolicyNone Never restarts
|
||||
// "no" is the value for docker run, "none" is the value in compose file (and default differ
|
||||
RestartPolicyNone = "none"
|
||||
// RestartPolicyOnFailure Restarts only on failure
|
||||
RestartPolicyOnFailure = "on-failure"
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue