Docker is an open-source platform designed to automate the deployment, scaling, and management of applications using containerization. Instead of running applications on traditional Virtual Machines (VMs) that bundle an entire operating system, Docker runs applications in lightweight, isolated environments called containers.
Docker uses a client-server architecture consisting of the following key components:
graph TD
Client[Docker CLI / Client] -->|Commands: run, build, pull| Daemon[Docker Daemon / dockerd]
subgraph Host Machine
Daemon -->|Manages| Containers[Containers]
Daemon -->|Stores| Images[Images]
end
subgraph Registry
Hub[Docker Hub / External Registry]
end
Daemon <-->|Pulls/Pushes| Hub
docker run, the client sends the command to dockerd (the Docker daemon), which executes it.dockerd): A persistent background service running on the host OS. It listens for Docker API requests and manages Docker objects such as images, containers, networks, and volumes.Traditional virtual machines require a hypervisor and a full guest operating system for each VM, consuming substantial CPU, RAM, and disk space. In contrast, Docker containers share the host operating system’s kernel, resulting in near-instant startup times and minimal resource overhead.
| Feature | Docker Containers | Virtual Machines |
|---|---|---|
| Architecture | Share host OS kernel; isolated user space. | Complete guest OS running on a hypervisor. |
| Startup Time | Milliseconds | Minutes |
| Storage Footprint | Extremely small (typically MBs) | Large (typically GBs) |
| Performance | Native system performance | Virtualization overhead |
stapp01)tonydocker-ce, docker-ce-cli, containerd.io, docker-compose-pluginEstablish an SSH connection to App Server 1:
ssh tony@stapp01
Provide the server password when prompted.
Before installing Docker, configure the official Docker CE repository on CentOS/RHEL using yum-utils:
# Install yum-utils helper utility
sudo yum install -y yum-utils
# Add the official stable Docker repository
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
Install the core Docker engine, command-line interface, container runtime (containerd), and the Docker Compose plugin:
sudo yum install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
Initiate the Docker background service (dockerd) and configure it to boot automatically when the server starts up:
# Start Docker daemon
sudo systemctl start docker
# Enable Docker service at boot
sudo systemctl enable docker
Check the status of the Docker systemd unit to verify it is active and running:
systemctl status docker
Expected Output snippet:
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
Active: active (running) since Sat 2026-07-11 08:00:00 UTC; 10s ago
Confirm that Docker Engine and Docker Compose are correctly installed and reporting versions:
# Check Docker Engine version
docker --version
# Check Docker Compose version
docker compose version
Ensure that the Docker daemon can successfully pull images and execute containers:
sudo docker run hello-world
Log out of the Application Server:
exit