Docker Editions: Community vs. Enterprise
Docker provides two primary distributions tailored to different use cases: Docker Community Edition (CE) and Docker Enterprise Edition (EE).
Docker Community Edition (CE) is the open-source variant maintained by the Docker community. It is available free of charge and is ideally suited for individual developers and small teams looking to start containerizing applications.
Docker Enterprise Edition (EE) is a commercial offering designed for large-scale business use and IT teams. It includes certified containers, plug-ins, and enterprise-grade security features. Unlike CE, EE comes with dedicated support from the vendor's technical team.
Releases are categorized into two channels: Stable and Edge. The Stable channel receives quarterly updates, prioritizing reliability, while the Edge channel is updated monthly, offering the latest features. For most development scenarios, Docker CE provides sufficient functionality.
Installing Docker CE on CentOS
Cleaning Up Existing Installations
If you have older versions of Docker installed, it is recommended to remove them to avoid conflicts.
# Check for installed Docker packages
sudo yum list installed | grep docker
# Remove old Docker packages
sudo yum remove docker-ce \
docker-ce-cli \
containerd.io
Step 1: Installing Dependencies
Install the required system utilities for managing the repository and device mapper.
sudo yum install -y yum-utils \
device-mapper-persistent-data \
lvm2
Step 2: Configuring the Repository
Add the Docker CE repository. Using a mirror (such as Aliyun) is recommended for improved download speeds in certain regions.
sudo yum-config-manager \
--add-repo \
http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
Step 3: Installing Docker CE
You can install the latest available version or a specific version string.
# Install the latest version
sudo yum install docker-ce docker-ce-cli containerd.io
# Alternatively, install a specific version (e.g., 18.03.1)
sudo yum install docker-ce-18.03.1.ce-1.el7.centos
Step 4: Starting the Service
Enable and start the Docker daemon.
sudo systemctl start docker
sudo systemctl enable docker
Verify the installation by checking the version:
docker version
Installing Docker CE on Ubuntu
Step 1: Updating and Installing Prerequisites
Update the package index and install tools to allow apt to use a repository over HTTPS.
sudo apt-get update
sudo apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
Step 2: Adding the GPG Key
Add the official Docker GPG key to ensure package authenticity.
curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
Step 3: Setting Up the Repository
Add the stable repository to your apt sources.
sudo add-apt-repository \
"deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu \
$(lsb_release -cs) \
stable"
Step 4: Installation
Udpate the package index again and install Docker CE.
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io
To install a specific version, list available versions first and target the specific string:
# apt-cache madison docker-ce
# sudo apt-get install docker-ce=<VERSION_STRING>
Configuring Registry Mirrors
When pulling images from the official Docker Hub in certain regions, network latency can significantly slow down the process or cause timeouts. Configuring a registry mirror (accelerator) resolves this by routing requests through a faster, local mirror.
To configure the Aliyun registry mirrer, modify the Docker daemon configuration file:
sudo mkdir -p /etc/docker
sudo cat <<EOF > /etc/docker/daemon.json
{
"registry-mirrors": ["https://iq2s3ero.mirror.aliyuncs.com"]
}
EOF
Apply the changes by restarting the daemon:
sudo systemctl daemon-reload
sudo systemctl restart docker