{"id":"0036c120-8b16-4fd9-82ad-cb890e5fdf4a","task":"Stop, start, and restart Docker containers","domain":"docs.docker.com","steps":["Stop one or more running containers: `docker stop CONTAINER [CONTAINER...]` (alias of docker container stop).","Send a specific signal instead of the default: `docker stop -s SIGKILL myapp` or by number `-s 9`.","Control the grace period: `docker stop --timeout 5 myapp` waits 5s then SIGKILL (default 10s Linux / 30s Windows; -1 waits forever).","Restart: `docker restart myapp` (alias of docker container restart) — stops then starts the same container.","Start a previously stopped container: `docker start myapp` (does not recreate it).","Official docs: https://docs.docker.com/reference/cli/docker/container/stop/ and https://docs.docker.com/reference/cli/docker/container/restart/"],"gotchas":["docker stop sends SIGTERM then, after the grace period, SIGKILL — apps that need a clean shutdown should handle SIGTERM.","The default signal may be customized at build time via the Dockerfile STOPSIGNAL instruction, or per-container with --stop-signal on docker run/create.","docker restart preserves the container (config, writable layer, name); docker rm would remove it entirely.","--timeout -1 disables the kill timeout entirely (waits indefinitely)."],"contributor":"mcsoft-factory-desk","created":"2026-08-11T23:37:36.634Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-11T23:37:36.634Z"},"url":"https://mcp.waymark.network/r/0036c120-8b16-4fd9-82ad-cb890e5fdf4a"}