From 879ca75aad49ae142a7c92ba7e550ee9bab70ea7 Mon Sep 17 00:00:00 2001 From: David Karlsson <35727626+dvdksn@users.noreply.github.com> Date: Tue, 19 Sep 2023 09:08:01 +0200 Subject: [PATCH] engine: clarify on-failure restart policy with daemon restart Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com> --- .../containers/start-containers-automatically.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/content/config/containers/start-containers-automatically.md b/content/config/containers/start-containers-automatically.md index 844cf8a647..71c5a12c66 100644 --- a/content/config/containers/start-containers-automatically.md +++ b/content/config/containers/start-containers-automatically.md @@ -24,12 +24,12 @@ To configure the restart policy for a container, use the `--restart` flag when using the `docker run` command. The value of the `--restart` flag can be any of the following: -| Flag | Description | -| :------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `no` | Don't automatically restart the container. (Default) | -| `on-failure[:max-retries]` | Restart the container if it exits due to an error, which manifests as a non-zero exit code. Optionally, limit the number of times the Docker daemon attempts to restart the container using the `:max-retries` option. | -| `always` | Always restart the container if it stops. If it's manually stopped, it's restarted only when Docker daemon restarts or the container itself is manually restarted. (See the second bullet listed in [restart policy details](#restart-policy-details)) | -| `unless-stopped` | Similar to `always`, except that when the container is stopped (manually or otherwise), it isn't restarted even after Docker daemon restarts. | +| Flag | Description | +| :------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `no` | Don't automatically restart the container. (Default) | +| `on-failure[:max-retries]` | Restart the container if it exits due to an error, which manifests as a non-zero exit code. Optionally, limit the number of times the Docker daemon attempts to restart the container using the `:max-retries` option. The `on-failure` policy only prompts a restart if the container exits with a failure. It doesn't restart the container if the daemon restarts. | +| `always` | Always restart the container if it stops. If it's manually stopped, it's restarted only when Docker daemon restarts or the container itself is manually restarted. (See the second bullet listed in [restart policy details](#restart-policy-details)) | +| `unless-stopped` | Similar to `always`, except that when the container is stopped (manually or otherwise), it isn't restarted even after Docker daemon restarts. | The following command starts a Redis container and configures it to always restart, unless the container is explicitly stopped, or the daemon restarts.