Browse code

Update flag usages and docs for max restart count

Signed-off-by: Michael Crosby <michael@docker.com>

Michael Crosby authored on 2014/08/14 10:21:15
Showing 2 changed files
... ...
@@ -992,7 +992,7 @@ removed before the image is removed.
992 992
                                    format: ip:hostPort:containerPort | ip::containerPort | hostPort:containerPort
993 993
                                    (use 'docker port' to see the actual mapping)
994 994
       --privileged=false         Give extended privileges to this container
995
-      --restart=""               Restart policy to apply when a container exits (no, on-failure, always)
995
+      --restart=""               Restart policy to apply when a container exits (no, on-failure[:max-retry], always)
996 996
       --rm=false                 Automatically remove the container when it exits (incompatible with -d)
997 997
       --sig-proxy=true           Proxy received signals to the process (even in non-TTY mode). SIGCHLD, SIGSTOP, and SIGKILL are not proxied.
998 998
       -t, --tty=false            Allocate a pseudo-TTY
... ...
@@ -1244,6 +1244,7 @@ the container exits, Docker will restart it.
1244 1244
 This will run the `redis` container with a restart policy of ** on-failure ** and a 
1245 1245
 maximum restart count of 10.  If the `redis` container exits with a non-zero exit 
1246 1246
 status more than 10 times in a row Docker will abort trying to restart the container.
1247
+Providing a maximum restart limit is only valid for the ** on-failure ** policy.
1247 1248
 
1248 1249
 ## save
1249 1250
 
... ...
@@ -73,7 +73,7 @@ func parseRun(cmd *flag.FlagSet, args []string, sysInfo *sysinfo.SysInfo) (*Conf
73 73
 		flCpuShares       = cmd.Int64([]string{"c", "-cpu-shares"}, 0, "CPU shares (relative weight)")
74 74
 		flCpuset          = cmd.String([]string{"-cpuset"}, "", "CPUs in which to allow execution (0-3, 0,1)")
75 75
 		flNetMode         = cmd.String([]string{"-net"}, "bridge", "Set the Network mode for the container\n'bridge': creates a new network stack for the container on the docker bridge\n'none': no networking for this container\n'container:<name|id>': reuses another container network stack\n'host': use the host network stack inside the container.  Note: the host mode gives the container full access to local system services such as D-bus and is therefore considered insecure.")
76
-		flRestartPolicy   = cmd.String([]string{"-restart"}, "", "Restart policy to apply when a container exits (no, on-failure, always)")
76
+		flRestartPolicy   = cmd.String([]string{"-restart"}, "", "Restart policy to apply when a container exits (no, on-failure[:max-retry], always)")
77 77
 		// For documentation purpose
78 78
 		_ = cmd.Bool([]string{"#sig-proxy", "-sig-proxy"}, true, "Proxy received signals to the process (even in non-TTY mode). SIGCHLD, SIGSTOP, and SIGKILL are not proxied.")
79 79
 		_ = cmd.String([]string{"#name", "-name"}, "", "Assign a name to the container")