Docker介绍
Docker:一个开源的基于go语言的应用容器引擎。
- 实现 在操作系统层面上实现虚拟化,直接复用本地主机的操作系统,而传统虚拟机则是在硬件层面实现虚拟化。
- 优点 启动速度快,占用体积小。
- 组成 docker守护进程(容器运行+镜像)
Docker安装
- 更新yum包 ,sudo yum update;
- 安装Docker依赖的包 ,sudo yum install -y yum-utils device-mapper-persistent-data lvm2;
- 设置yum源 ,sudo yum-config-manager --add-repo http://mirrors.ustc.edu.cn/docker-ce/linux/centos/docker-ce.repo;
- 安装 ,sudo yum install -y docker-ce;
若第4步出现Error: docker-ce conflicts with 2:docker-1.13.1-203.git0be3e21.el7.centos.x86_64则是已存在docker或者卸载不完全
- 查看已经安装好的docker安装包
[root@localhost ~]# yum list installed | grep docker
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
docker.x86_64 2:1.13.1-203.git0be3e21.el7.centos
docker-client.x86_64 2:1.13.1-203.git0be3e21.el7.centos
docker-common.x86_64 2:1.13.1-203.git0be3e21.el7.centos - 卸载–删除安装包
[root@localhost ~]#yum –y remove docker.x86_64
[root@localhost ~]#yum –y remove docker-client.x86_64
[root@localhost ~]#yum –y remove docker-common.x86_64 - 删除docker镜像
[root@localhost ~]# rm -rf /var/lib/docker
设置Docker源
创建配置文件
mkdir /etc/docker
vi /etc/docker/daemon.json
编辑配置文件
{
“registry-mirrors”:[“https://docker.mirrors.ustc.edu.cn”]
}
本文介绍了在CentOS7系统中如何安装Docker应用容器引擎。首先更新yum包,然后安装依赖,设置Docker的yum源,接着安装Docker。如果遇到旧版本的Docker冲突,需要先卸载再重新安装。最后,通过创建配置文件来设置Docker源,提高下载速度。
1110

被折叠的 条评论
为什么被折叠?



