1. Stop a container
docker stop sends SIGTERM, then SIGKILL after a grace period, halting the container.
docker stop webTyporithm · medium
Step 1 of 8 · intro card
Containers
Containers move through created → running → stopped → removed. docker stop sends SIGTERM then SIGKILL, docker rm deletes a stopped container, docker inspect shows full config and IP, and prune reclaims dangling images. Containers are ephemeral, so persist state in volumes.
A container's lifecycle is created → running → stopped → removed. docker stop web triggers a graceful shutdown: it sends SIGTERM, waits a grace period, then sends SIGKILL if the process has not exited.
docker rm web deletes a stopped container, releasing its name and writable layer. docker inspect web dumps the full JSON config — image, mounts, environment, and the assigned IP address.
docker image prune -a reclaims disk by removing unused images (volume pruning is separate). Because containers are ephemeral, keep important state in volumes and add restart policies so containers come back after crashes or reboots.
Lifecycle: created → running → stopped → removed.
stop = SIGTERM then SIGKILL; rm deletes a stopped container.
inspect shows config and IP; prune reclaims disk.
docker stop web
docker rm web
docker image prune -a
docker inspect webConnect each part of the code to the concept before you type.
docker stop sends SIGTERM, then SIGKILL after a grace period, halting the container.
docker stop webdocker rm deletes a stopped container, freeing its name and writable layer.
docker rm webdocker image prune -a removes unused images to reclaim disk space.
docker image prune -adocker inspect prints the full JSON config, including the container's IP address.
docker inspect webRead the concept map and follow the code breakdown.
Type the implementation, repair mistakes and work through every recall exercise.
Use the final check without hints; revisit weak concepts in short practice sessions.