- Package Acquisition ====================
Download the static binary archive for Docker CE 18.06.3 compatible with x86_64 systems:
wget https://download.docker.com/linux/static/stable/x86_64/docker-18.06.3-ce.tgz
Ensure the version aligns with Kubernetes compatibility requirements — versions prior to 18.06 may lack critical features or exhibit instability in orchestrated environments.
- Binary Deployment ==================
Extract and install binaries:
sudo tar -xzf docker-18.06.3-ce.tgz
sudo cp docker/* /usr/bin/
Define a systemd unit file at /etc/systemd/system/container-engine.service (using a distinct service name to avoid naming conflicts):
[Unit]
Description=Container Runtime Engine
Documentation=https://docs.docker.com/engine/
After=network.target
Wants=network.target
[Service]
Type=notify
ExecStart=/usr/bin/dockerd --host=fd://
ExecReload=/bin/kill -s HUP $MAINPID
LimitNOFILE=65536
LimitNPROC=65536
LimitCORE=infinity
Restart=on-failure
RestartSec=5
StartLimitBurst=3
StartLimitInterval=60
TimeoutStartSec=0
Delegate=yes
KillMode=process
[Install]
WantedBy=multi-user.target
Assign execution permissions:
sudo chmod 644 /etc/systemd/system/container-engine.service
- Service Activation ===================
Reload configuration and launch the runtime:
sudo systemctl daemon-reload
sudo systemctl start container-engine
sudo systemctl enable container-engine
Verify operation:
sudo systemctl status container-engine
sudo docker version --format '{{.Server.Version}}'
- Runtime Configuration ======================
Customize storage location and registry behavior by creating /etc/docker/daemon.json:
{
"registry-mirrors": ["https://<your-unique-mirror-id>.mirror.aliyuncs.com"],
"data-root": "/home/data/docker"
}
Before applying changes, prepare the target directroy:
sudo mkdir -p /home/data/docker
To obtain a personalized mirror URL:
- Log into the Alibaba Cloud console.
- Navigate to Container Registry → Image Acceleration.
- Copy the endpoint under Accelerator Address.
Apply the updated configuraton:
sudo systemctl restart container-engine
- Validation Steps =================
Confirm correct initialization and path resolution:
sudo docker info | grep -E "^(Docker Root Dir|Registry Mirrors)"
The output should reflect /home/data/docker as the root directory and list the configured mirror URI.