Getting Started with Docker: Installation and Basics

What Is Docker?

Docker is an open-source platform that enables developers to build, deploy, and run applications in isolated environments called containers. It follows a client-server architecture where the Docker client communicates with the Docker daemon (server), which handles container creation, execution, and distribution. Communication occurs via REST APIs, UNIX sockets, or network interfaces. Tools like Docker Compose extend functionality by managing multi-container applications.

Core Concepts

  • Images: Read-only templates used to create containers. They include every thing needed to run an application—OS libraries, binaries, and code.
  • Containers: Runnable instances of images. Each container is isolated and can be started, stopped, or deleted independently.
  • Registries: Repositories for storing and distributing Docker images. Public registries like Docker Hub host numerous images tagged for versioning.

Common Use Cases

  • Automating application packaging and deployment
  • Building lightweight private PaaS environments
  • Enabling CI/CD pipelines with automated testing
  • Scaling web apps, databases, and backend services efficiently

Installing Docker on Windows

Since Docker relies on Linux kernel features, native support is limited on Windows. Docker Desktop for Windows uses Hyper-V to provide a Linux-compatible environment.

Windows 10

  1. Enable Hyper-V:
    • Right-click Start → Apps & Features → Programs and Features → Turn Windows features on or off
    • Check Hyper-V and restart you're machine
  2. Download Docker Desktop from official site
  3. Run installer and follow prompts (accept defaults)
  4. After installation, verify using PowerShell or Git Bash: ``` docker version docker run hello-world
    
    

Note: Enabling Hyper-V disables other virtualization tools like VMware Workstation or VirtualBox.

Windows 7/8

Use Docker Toolbox, which includes VirtualBox and a preconfigured Linux VM:

  • Download from Alibaba Cloud mirror
  • Install with default settings
  • Launch Docker Quickstart Terminal; if prompted for bash.exe, point to your Git installation (e.g., C:\Program Files\Git\bin\bash.exe)
  • Default credentials inside the VM: docker / tcuser

Installing Docker on Linux

Online Installation (CentOS/RHEL)

Use Alibaba Cloud's mirror for faster downloads:

# Add Docker CE repository
sudo wget https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo -O /etc/yum.repos.d/docker-ce.repo

# Install specific version
sudo yum install docker-ce-19.03.15 docker-ce-cli-19.03.15 containerd.io

# Start and enable Docker service
sudo systemctl start docker
sudo systemctl enable docker

Configure registry mirrors for improved image pull speed by editing /etc/docker/daemon.json:

{
  "registry-mirrors": ["https://registry.docker-cn.com"]
}

Then reload the daemon: sudo systemctl reload docker.

Offline Installation

When internet acces is unavailable, install RPM packages manually:

rpm -ivh lxc-libs-1.0.9-1.el6.x86_64.rpm
rpm -ivh lua-alt-getopt-0.7.0-1.el6.noarch.rpm
rpm -ivh lua-filesystem-1.4.2-1.el6.x86_64.rpm
rpm -ivh lua-lxc-1.0.9-1.el6.x86_64.rpm  
rpm -ivh lxc-1.0.9-1.el6.x86_64.rpm  
rpm -ivh docker-io-1.7.1-2.el6.x86_64.rpm
rpm -ivh device-mapper-libs-1.02.117-12.el6.x86_64.rpm --force --nodeps

Essential Docker Commands

  • Pull an image: docker pull nginx:alpine
  • List local images: docker images
  • Remove an image: docker rmi nginx:alpine or by ID
  • Show running containers: docker ps
  • Show all containers: docker ps -a
  • Control containers: ``` docker start my_container docker stop my_container docker restart my_container
  • Attach to a running container: docker attach my_container
  • Delete a container: docker rm my_container
  • Display system info: docker info

Tags: docker containerization Linux Windows devops

Posted on Wed, 13 May 2026 09:20:11 +0000 by vinny69