Docker - Container Basics
Docker container lifecycle and basic operations
dockerDocker: Platform for developing, shipping, and running applications in containers
Container: Lightweight, standalone executable package with everything needed to run software
Image: Template for creating containers
# Container Lifecycle
docker run nginx # Create and start container
docker run -d nginx # Detached mode
docker run -it ubuntu bash # Interactive terminal
docker run --name web nginx # Named container
docker run -p 8080:80 nginx # Port mapping
# Container Management
docker ps # Running containers
docker# Container Inspection
docker logs container_id # View logs
docker logs -f container_id # Follow logs
docker exec -it container_id bash # Execute command
docker inspect container_id # Detailed info
docker stats # Resource usage
docker