0% found this document useful (0 votes)
63 views20 pages

Module 2 - Docker Installation & Configuration Deep Dive

This document outlines a workshop on Docker installation and configuration, detailing learning objectives, deployment options, system requirements, installation methods, and configuration files. It also covers performance tuning, common installation issues, troubleshooting techniques, and security best practices. Hands-on exercises are included to reinforce learning and address potential installation challenges.

Uploaded by

shahryar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views20 pages

Module 2 - Docker Installation & Configuration Deep Dive

This document outlines a workshop on Docker installation and configuration, detailing learning objectives, deployment options, system requirements, installation methods, and configuration files. It also covers performance tuning, common installation issues, troubleshooting techniques, and security best practices. Hands-on exercises are included to reinforce learning and address potential installation challenges.

Uploaded by

shahryar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd

MODULE 2: DOCKER

INSTALLATION & CONFIGURATION


DEEP DIVE
Docker & Containerization Workshop

Presented by: Choudhry Shehryar, MLOps Engineer


Learning Objectives

● Install and configure Docker in various environments


● Understand Docker's underlying dependencies and
requirements
● Configure Docker for optimal performance and security
Docker Deployment Options

Docker Engine

● Core container runtime for production environments


● CLI-focused, lightweight, server-oriented
● Native to Linux, available on Windows Server

Docker Desktop

● GUI-enhanced development environment


● Built-in Kubernetes, volume mounts, networking
● Available for Mac, Windows, Linux
System RequirementsWindows/Mac Desktop
● Windows 10/11 Pro+ or macOS 10.15+
Linux ● 8GB RAM recommended
● Virtualization support
● 64-bit kernel (3.10+)
● systemd / systemctl
● 4GB RAM (minimum)

Windows Server

● Windows Server 2016/2019/2022


● Hyper-V or WSL2
● 4GB RAM (minimum)
Installation Architecture
Core Components
● Docker daemon (dockerd)
● REST API
● Docker CLI client
Linux Installation Methods
Automated Script

Package Manager bash

bash curl -fsSL


# Ubuntu/Debian https://get.docker.com | sh

apt-get update && apt-get install Manual Binary Installation


docker-ce
● Download from docker.com
● Systemd service
configuration
# CentOS/RHEL
Windows Server Installation
Using PowerShell

powershell
Install-Module -Name DockerMsftProvider -Force
Install-Package -Name Docker -ProviderName DockerMsftProvider -Force

Restart-Computer -Force

Windows Features

● Containers feature
● Hyper-V role (for Windows containers)
● Windows Server Core vs Desktop Experience
Docker Desktop Installation
Key Features

● GUI dashboard
● Container/image management
● Extension marketplace
● Volume/network mapping

Post-Installation

● Resource allocation
● WSL2 integration (Windows)
● Kubernetes enablement
Configuration Files
Linux

● /etc/docker/daemon.json
● /etc/systemd/system/
docker.service.d/

Windows

● C:\ProgramData\docker\config\
daemon.json

Docker Desktop

● Settings/Preferences GUI
Essential Configuration Parameters
{
"data-root": "/var/lib/docker",
"storage-driver": "overlay2",
"log-driver": "json-file",
"log-opts": {
"max-size": "10m",
"max-file": "3"
},
"registry-mirrors": ["https://registry.example.com"],
"insecure-registries": ["10.10.10.10:5000"]

}
Storage Drivers
Overlay2 (recommended)

● Fast and stable


● Good for most Linux distributions

Btrfs/ZFS

● Better for high I/O workloads


● Advanced snapshot capabilities

Device Mapper

● For older Linux kernels


● Direct-lvm mode recommended
Network Configuration

Custom Bridge Configuration


Default Networks
{
● bridge: Default container
network "bridge": "docker0",
● host: Uses host's "fixed-cidr": "172.17.0.0/16",
networking
● none: Disables networking "dns": ["8.8.8.8", "8.8.4.4"]

}
Registry Configuration
Authentication Mirror Configuration
{ json

"auths": { {

"registry.example.com": { "registry-mirrors": [
"https://mirror.gcr.io",
"auth": "base64encoded"
"https://registry-1.docker.io"
}
]
}
}
Performance Tuning
Linux System Settings
Resource Limits
● Increase file descriptors
{ "default-shm-size": "64M",
● Adjust TCP parameters
"default-ulimits": { ● Memory swappiness

"nofile": {

"Name": "nofile",

"Hard": 64000,

"Soft": 32000 }}}


Installation Verification
System Verification
docker info
docker version
docker system info
Connectivity Test
docker run hello-world
Resource Usage
docker stats
Common Installation Issues

● Insufficient permissions
● Missing dependencies
● Conflicting versions
● Proxy configuration
● Firewall blocking
● Storage driver incompatibility
● Registry connectivity
Troubleshooting Techniques
Log Analysis
journalctl -u docker.service
Service Status
systemctl status docker
Daemon Restart
systemctl restart docker
Connectivity Testing
curl -v https://registry-1.docker.io/v2/
Security Best Practices

● Run Docker as non-root (Rootless Mode)


● Configure TLS for Docker daemon
● Use content trust for image verification
● Limit container capabilities
● Regular security updates
● Use secure registries
Hands-On Exercises

1. Install Docker Engine on Linux


2. Configure custom daemon
settings
3. Validate installation
4. Troubleshoot common issues
5. Set up registry access
6. Performance tune your
installation
Questions & Next Steps

Installation challenges?

Specific environment concerns?

Advanced configuration needs?

You might also like