参考 Docker官网 https://docs.docker.com/engine/install/centos/
添加Docker镜像源
# 提供yum-config-manager工具
sudo yum install -y yum-utils
# 添加Docker镜像源
sudo yum-config-manager \
--add-repo \
https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo # 使用阿里云仓库
#https://download.docker.com/linux/centos/docker-ce.repo
选择Docker版本
# 查看docker版本列表
yum list docker-ce --showduplicates | sort -r
output:
docker-ce.x86_64 3:20.10.9-3.el8 docker-ce-stable
docker-ce.x86_64 3:20.10.8-3.el8 docker-ce-stable
docker-ce.x86_64 3:20.10.7-3.el8 docker-ce-stable
docker-ce.x86_64 3:20.10.6-3.el8 docker-ce-stable
docker-ce.x86_64 3:20.10.5-3.el8 docker-ce-stable
docker-ce.x86_64 3:20.10.4-3.el8 docker-ce-stable
docker-ce.x86_64 3:20.10.3-3.el8 docker-ce-stable
docker-ce.x86_64 3:20.10.2-3.el8 docker-ce-stable
docker-ce.x86_64 3:20.10.10-3.el8 docker-ce-stable
docker-ce.x86_64 3:20.10.1-3.el8 docker-ce-stable
docker-ce.x86_64 3:20.10.0-3.el8 docker-ce-stable
docker-ce.x86_64 3:19.03.15-3.el8 docker-ce-stable
docker-ce.x86_64 3:19.03.15-3.el8 @docker-ce-stable
docker-ce.x86_64 3:19.03.14-3.el8 docker-ce-stable
docker-ce.x86_64 3:19.03.13-3.el8 docker-ce-stable
选择版本 19.03.15
安装
## 最新稳定版
sudo yum install docker-ce docker-ce-cli containerd.io
## 安装指定版本19.03.15
sudo yum install docker-ce-19.03.15 docker-ce-cli-19.03.15 containerd.io
镜像加速
# "graph": "/home/docker", # Docker存储目录
sudo touch /etc/docker/daemon.json
sudo cat <<-'EOF' >/etc/docker/daemon.json
{
"registry-mirrors": ["https://yn0x8uqa.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
开机启动
# 启动docker
sudo systemctl start docker
# 设置开机自启动
systemctl enable docker.service
启动测试
# 解决runc: symbol lookup error: runc: undefined symbol: seccomp_api_get
sudo yum install libseccomp-devel
# 测试
sudo docker run hello-world
标签:x86,记录,ce,el8,64,stable,Docker,安装,docker
From: https://www.cnblogs.com/renzhsh/p/16630757.html