Master the complete container lifecycle: creating, starting, stopping, restarting, and removing containers. Learn to manage container resources and troubleshoot common issues.
Learn about the different states a container can be in: created, running, paused, exited.
docker run -d --name demo-nginx nginxdocker psdocker stop demo-nginxdocker ps -aContainers transition through states: created ā running ā stopped (exited). The `ps` command shows running containers, while `ps -a` shows all containers regardless of state.
You'll see the container appear in 'docker ps' with UP status, then after stopping it will show 'Exited' status in 'docker ps -a'.