Docker 要求 CentOS 系統的內核版本高於 3.10 ,查看本頁面的前提條件來驗證你的CentOS 版本是否支持 Docker 。通過 uname -r 命令查看你當前的內核版本
uname -r
安裝一些必要的系統工具:
yum install -y yum-utils device-mapper-persistent-data lvm2
添加軟件源信息:
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
更新 yum 緩存:
yum makecache fast
安裝 Docker-ce:
yum -y install docker-ce
啓動 Docker 後臺服務
systemctl start docker
測試運行 hello-world
docker run hello-world
鏡像加速
cd /etc/docker
touch daemon.json
{ "registry-mirrors": ["http://hub-mirror.c.163.com"]}