1. 基于 CentOS 7 安装
1.1 安装步骤参考
官网安装参考手册:https://docs.docker.com/install/linux/docker-ce/centos/
1.2 确定Linux版本
确定你是CentOS7及以上版本
[root@centos7 bin]# cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)
1.3 yum安装gcc相关
需要保持联网
[root@centos7 bin]# yum -y install gcc
[root@centos7 bin]# yum -y install gcc-c++
1.4 卸载旧版本
yum -y remove docker docker-common docker-selinux docker-engine
官方版本
yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
1.5 安装包
[root@centos7 bin]# yum install -y yum-utils device-mapper-persistent-data lvm2
1.6 设置stable镜像仓库
国内的
[root@centos7 bin]# yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
1.7 更新yum软件包索引
yum makecache fast
1.8 安装Docker CE
[root@centos7 bin]# yum -y install docker-ce docker-ce-cli containerd.io
1.9 启动docker
[root@centos7 bin]# systemctl start docker
1.10 测试
[root@centos7 bin]# docker version
[root@centos7 bin]# docker run hello-world
[root@centos7 bin]# docker images
内容参考:
https://www.bilibili.com/video/BV187411y7hF
仅用于学习!