docker rm

Practice docker rm from memory. Removes stopped container and its writable layer (volumes survive unless -v). Won't remove a running container - use -f

Remove a stopped container.

docker rm nginx1

Removes stopped container and its writable layer (volumes survive unless -v). Won't remove a running container - use -f for that. Caution note: check the target, scope, and preview or dry-run options before using this on a real system.

Safety: Inspect state before stopping, pruning, or changing running containers.

Force-remove a running container without stopping it first.

docker rm -f nginx1

Combines stop and remove in one step (sends SIGKILL, no graceful shutdown). Use only when you don't care about clean exit. Safety note: in a real terminal, verify the exact target and backup path before running this.

Safety: Inspect state before stopping, pruning, or changing running containers.

Build the habit: DockerDrill drills docker rm and the rest of the Docker workflow until the safe first move is automatic. Try a Docker drill.