A beginner-friendly repository to learn Docker from the basics. This repository contains Dockerfiles, multi-stage builds, Docker Compose examples, commonly used commands, and common interview questions.
- Docker Basics
- Dockerfile Examples
- Multi-Stage Builds
- Docker Compose
- Docker Commands
- Environment Variables
- Volumes
- Networks
- Best Practices
- Sample Projects
- Interview Questions & Answers
docker-learning/
├── dockerfile/
├── multistage/
├── docker-compose/
├── commands/
├── interview-questions/
├── examples/
├── projects/
├── best-practices/
├── .dockerignore
├── .gitignore
└── README.md
- What Docker is and why it's used
- Building Docker images
- Running and managing containers
- Writing efficient Dockerfiles
- Multi-stage Docker builds
- Docker Compose for multi-container applications
- Managing volumes and networks
- Working with environment variables
- Optimizing Docker images
- Docker best practices
- Common interview questions
- Basic knowledge of the command line
- Docker Desktop or Docker Engine installed
- Git
Clone the repository:
git clone https://github.com/ahsan598/docker-learning.git
cd docker-learningNavigate to any folder and follow the examples provided.
- Basic Dockerfile
- Copying files
- Installing dependencies
- Exposing ports
- CMD vs ENTRYPOINT
- Environment variables
- Build stage
- Runtime stage
- Image optimization
- Production-ready builds
- Multiple services
- Networks
- Volumes
- Environment variables
- Compose commands
- Image commands
- Container commands
- Network commands
- Volume commands
- Cleanup commands
- Use lightweight base images
- Reduce image size
- Cache dependencies
- Avoid running as root
- Use
.dockerignore - Keep images secure