Merge pull request #15348 from tonistiigi/11008-always-unless-stopped-restart-policy

Add always-unless-stopped restart policy
Upstream-commit: fd8b25c802780683cc5776e6d3aaca9536e7370b
Component: engine
This commit is contained in:
Brian Goff
2015-08-24 13:48:56 -04:00
12 changed files with 99 additions and 10 deletions
@@ -278,7 +278,8 @@ Json Parameters:
- **Capdrop** - A list of kernel capabilities to drop from the container.
- **RestartPolicy** The behavior to apply when the container exits. The
value is an object with a `Name` property of either `"always"` to
always restart or `"on-failure"` to restart only when the container
always restart, `"unless-stopped"` to restart always except when
user has manually stopped the container or `"on-failure"` to restart only when the container
exit code is non-zero. If `on-failure` is used, `MaximumRetryCount`
controls the number of times to retry before giving up.
The default is not to restart. (optional)
@@ -59,7 +59,7 @@ Creates a new container.
--pid="" PID namespace to use
--privileged=false Give extended privileges to this container
--read-only=false Mount the container's root filesystem as read only
--restart="no" Restart policy (no, on-failure[:max-retry], always)
--restart="no" Restart policy (no, on-failure[:max-retry], always, unless-stopped)
--security-opt=[] Security options
-t, --tty=false Allocate a pseudo-TTY
--disable-content-trust=true Skip image verification
@@ -59,7 +59,7 @@ weight=1
--pid="" PID namespace to use
--privileged=false Give extended privileges to this container
--read-only=false Mount the container's root filesystem as read only
--restart="no" Restart policy (no, on-failure[:max-retry], always)
--restart="no" Restart policy (no, on-failure[:max-retry], always, unless-stopped)
--rm=false Automatically remove the container when it exits
--security-opt=[] Security Options
--sig-proxy=true Proxy received signals to the process
@@ -441,7 +441,16 @@ Docker supports the following restart policies:
<td>
Always restart the container regardless of the exit status.
When you specify always, the Docker daemon will try to restart
the container indefinitely.
the container indefinitely. The container will also always start
on daemon startup, regardless of the current state of the container.
</td>
</tr>
<tr>
<td><strong>unless-stopped</strong></td>
<td>
Always restart the container regardless of the exit status, but
do not start it on daemon startup if the container has been put
to a stopped state before.
</td>
</tr>
</tbody>
+10 -1
View File
@@ -402,7 +402,16 @@ Docker supports the following restart policies:
<td>
Always restart the container regardless of the exit status.
When you specify always, the Docker daemon will try to restart
the container indefinitely.
the container indefinitely. The container will also always start
on daemon startup, regardless of the current state of the container.
</td>
</tr>
<tr>
<td><strong>unless-stopped</strong></td>
<td>
Always restart the container regardless of the exit status, but
do not start it on daemon startup if the container has been put
to a stopped state before.
</td>
</tr>
</tbody>