Docker Mastery¶
Understand containers through stories and hands-on labs: Docker architecture, images and containers, Dockerfiles, port mapping, volumes and practical tasks.
Lessons
- Virtual Machine and The Grand House
- The Tale of Magic Kitchen : A Docker Architecture
- Virtual Machine vs Containers
- The Digital Tea Kadai – Client Server Architecture & Docker
- The Bakery, Recepies, Dough & Cookies – Registry, Repository, Images, Containers
- Running ‘Hello, World!’ with BusyBox: A Docker Adventure
- Step 1: Discovering BusyBox on Docker Hub
- Step 2: Exploring BusyBox Tags
- Step 3: Setting Up Your Docker Environment
- Step 4: Checking Local Images
- Step 5: Running Your First Container
- Step 6: Verifying the Image Download
- Step 7: Running the Container Again
- Step 8: Exploring the Container’s File System
- Step 9: Running a Container in Interactive Mode
- Step 10: Understanding Container Lifecycle
- Diving Deeper into Docker with Detached Mode, Naming, and Inspections
- Tomcat: Exploring Docker Port Mapping and Logs
- The Building Blocks – Detailed Structure of a Dockerfile
- The
FROMInstruction: Choosing the Foundation - The
LABELInstruction: Adding Metadata (Optional) - The
RUNInstruction: Building the Layers - The
COPYandADDInstructions: Bringing in Ingredients - The
WORKDIRInstruction: Setting the Workspace - The
CMDandENTRYPOINTInstructions: The Final Touch - Breakdown of the Dockerfile:
- Example Flask Application (
app.py): - Building and Running the Docker Image:
- The
- Docker Volumes Explained: A Quick Guide
Docker Tasks
- Pull the nginx image from Docker Hub and run it as a container. Map port 80 of the container to port
- Create a Dockerfile for a simple Node.js application that serves “Hello World” on port 3000.
- Run a container from the ubuntu image and start an interactive shell session inside it.
- Create a Dockerfile for a Go application that uses multi-stage builds to reduce the final image size
- Create a Docker volume and use it to persist data for a MySQL container.
- Add a health check to a Docker container running a simple Node.js application.