Container Management
docker
containers
management
Managing running containers: start, stop, logs, and inspection
Container Management
Scenario: Managing Production Containers
Task: Learn essential container management commands
π οΈ Essential Commands
Container Lifecycle
# Start/Stop/Restart
docker start mycontainer
docker stop mycontainer
docker restart mycontainer
# Remove container
docker rm mycontainer
# Remove stopped containers
docker container pruneInspecting Containers
# View logs
docker logs mycontainer
docker logs -f mycontainer # Follow
docker logs --tail 100 mycontainer
# Inspect details
docker inspect mycontainer
# Execute command in running container
docker exec -it mycontainer /bin/bash
# Check resource usage
docker stats mycontainerListing Containers
# Running containers
docker ps
# All containers (including stopped)
docker ps -a
# Format output
docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}"β Verification
π― Key Learnings
- Container lifecycle management
- Log analysis
- Debugging running containers
β Status
COMPLETED π
- Date: 2026-01-29