{
	"id": "36701334-fa11-4387-b0f7-3de25f6b64eb",
	"created_at": "2026-04-06T00:10:45.136654Z",
	"updated_at": "2026-04-10T03:21:34.878885Z",
	"deleted_at": null,
	"sha1_hash": "d98c8bc4e3ee901bdd3c4bb9d9004f5449894df9",
	"title": "Start containers automatically",
	"llm_title": "",
	"authors": "",
	"file_creation_date": "0001-01-01T00:00:00Z",
	"file_modification_date": "0001-01-01T00:00:00Z",
	"file_size": 47299,
	"plain_text": "Start containers automatically\r\nBy Docker Inc\r\nPublished: 2026-02-21 · Archived: 2026-04-05 15:04:16 UTC\r\nDocker provides restart policies to control whether your containers start automatically when they exit, or when\r\nDocker restarts. Restart policies start linked containers in the correct order. Docker recommends that you use\r\nrestart policies, and avoid using process managers to start containers.\r\nRestart policies are different from the --live-restore flag of the dockerd command. Using --live-restore\r\nlets you to keep your containers running during a Docker upgrade, though networking and user input are\r\ninterrupted.\r\nTo configure the restart policy for a container, use the --restart flag when using the docker run command.\r\nThe value of the --restart flag can be any of the following:\r\nFlag Description\r\nno Don't automatically restart the container. (Default)\r\non-failure[:max-retries]\r\nRestart the container if it exits due to an error, which manifests as a non-zero exit code.\r\nOptionally, limit the number of times the Docker daemon attempts to restart the\r\ncontainer using the :max-retries option. The on-failure policy only prompts a\r\nrestart if the container exits with a failure. It doesn't restart the container if the daemon\r\nrestarts.\r\nalways\r\nAlways restart the container if it stops. If it's manually stopped, it's restarted only when\r\nDocker daemon restarts or the container itself is manually restarted. (See the second\r\nbullet listed in restart policy details)\r\nunless-stopped\r\nSimilar to always , except that when the container is stopped (manually or otherwise),\r\nit isn't restarted even after Docker daemon restarts.\r\nThe following command starts a Redis container and configures it to always restart, unless the container is\r\nexplicitly stopped, or the daemon restarts.\r\nThe following command changes the restart policy for an already running container named redis .\r\nThe following command ensures all running containers restart.\r\nRestart policy details\r\nKeep the following in mind when using restart policies:\r\nhttps://docs.docker.com/config/containers/start-containers-automatically/\r\nPage 1 of 3\n\nA restart policy only takes effect after a container starts successfully. In this case, starting successfully\r\nmeans that the container is up for at least 10 seconds and Docker has started monitoring it. This prevents a\r\ncontainer which doesn't start at all from going into a restart loop.\r\nIf you manually stop a container, the restart policy is ignored until the Docker daemon restarts or the\r\ncontainer is manually restarted. This prevents a restart loop.\r\nRestart policies only apply to containers. To configure restart policies for Swarm services, see flags related\r\nto service restart.\r\nRestarting foreground containers\r\nWhen you run a container in the foreground, stopping a container causes the attached CLI to exit as well,\r\nregardless of the restart policy of the container. This behavior is illustrated in the following example.\r\n1. Create a Dockerfile that prints the numbers 1 to 5 and then exits.\r\n2. Build an image from the Dockerfile.\r\n3. Run a container from the image, specifying always for its restart policy.\r\nThe container prints the numbers 1..5 to stdout, and then exits. This causes the attached CLI to exit as well.\r\n4. Running docker ps shows that is still running or restarting, thanks to the restart policy. The CLI session\r\nhas already exited, however. It doesn't survive the initial container exit.\r\n5. You can re-attach your terminal to the container between restarts, using the docker container attach\r\ncommand. It's detached again the next time the container exits.\r\nIf restart policies don't suit your needs, such as when processes outside Docker depend on Docker containers, you\r\ncan use a process manager such as systemd or supervisor instead.\r\nDon't combine Docker restart policies with host-level process managers, as this creates conflicts.\r\nTo use a process manager, configure it to start your container or service using the same docker start or docker\r\nservice command you would normally use to start the container manually. Consult the documentation for the\r\nspecific process manager for more details.\r\nUsing a process manager inside containers\r\nProcess managers can also run within the container to check whether a process is running and starts/restart it if\r\nnot.\r\nThese aren't Docker-aware, and only monitor operating system processes within the container. Docker\r\ndoesn't recommend this approach, because it's platform-dependent and may differ between versions of a\r\ngiven Linux distribution.\r\nhttps://docs.docker.com/config/containers/start-containers-automatically/\r\nPage 2 of 3\n\nSource: https://docs.docker.com/config/containers/start-containers-automatically/\r\nhttps://docs.docker.com/config/containers/start-containers-automatically/\r\nPage 3 of 3",
	"extraction_quality": 1,
	"language": "EN",
	"sources": [
		"MITRE"
	],
	"references": [
		"https://docs.docker.com/config/containers/start-containers-automatically/"
	],
	"report_names": [
		"start-containers-automatically"
	],
	"threat_actors": [],
	"ts_created_at": 1775434245,
	"ts_updated_at": 1775791294,
	"ts_creation_date": 0,
	"ts_modification_date": 0,
	"files": {
		"pdf": "https://archive.orkl.eu/d98c8bc4e3ee901bdd3c4bb9d9004f5449894df9.pdf",
		"text": "https://archive.orkl.eu/d98c8bc4e3ee901bdd3c4bb9d9004f5449894df9.txt",
		"img": "https://archive.orkl.eu/d98c8bc4e3ee901bdd3c4bb9d9004f5449894df9.jpg"
	}
}