Centos 7系统安装Docker应用容器引擎

Centos 7系统安装Docker应用容器引擎

Docker介绍

Docker:一个开源的基于go语言的应用容器引擎。

  1. 实现 在操作系统层面上实现虚拟化,直接复用本地主机的操作系统,而传统虚拟机则是在硬件层面实现虚拟化。
  2. 优点 启动速度快,占用体积小。
  3. 组成 docker守护进程(容器运行+镜像)

Docker安装

  1. 更新yum包 ,sudo yum update;
  2. 安装Docker依赖的包 ,sudo yum install -y yum-utils device-mapper-persistent-data lvm2;
  3. 设置yum源 ,sudo yum-config-manager --add-repo http://mirrors.ustc.edu.cn/docker-ce/linux/centos/docker-ce.repo;
  4. 安装 ,sudo yum install -y docker-ce;

若第4步出现Error: docker-ce conflicts with 2:docker-1.13.1-203.git0be3e21.el7.centos.x86_64则是已存在docker或者卸载不完全

  1. 查看已经安装好的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
  2. 卸载–删除安装包
    [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
  3. 删除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”]
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值