zoukankan      html  css  js  c++  java
  • centos 7 yum安装docker

    注意:Docker 要求 CentOS 系统的内核版本高于 3.10 ,查看本页面的前提条件来验证你的CentOS 版本是否支持 Docker 。

    **1.通过 uname -r 命令查看你当前的内核版本 **

    [root@VM_0_2_centos ~]#uname -r
    

    2.卸载老版本的 docker 及其相关依赖

    [root@VM_0_2_centos ~]#yum remove docker docker-common 
    container-selinux docker-selinux docker-engine
    

    3.安装需要的软件包(yum-util 提供yum-config-manager功能,另外两个是devicemapper驱动依赖的)

    [root@VM_0_2_centos ~]#yum install -y yum-utils 
    device-mapper-persistent-data 
    lvm2
    

    4.添加官方yum源

    [root@VM_0_2_centos ~]#yum-config-manager 
    --add-repo https://download.docker.com/linux/centos/docker-ce.repo
    

    由于网速问题,建议使用国内源。执行下列命令添加yum软件源:

    [root@VM_0_2_centos ~]#yum-config-manager  --add-repo 
    https://mirrors.ustc.edu.cn/docker-ce/linux/centos/docker-ce.repo
    

    5.更新索引

    [root@VM_0_2_centos ~]#yum makecache fast
    

    6.安装 docker-ce

    [root@VM_0_2_centos ~]#yum install -y docker-ce
    

    7.启动并加入开机启动

    [root@VM_0_2_centos ~]#systemctl start docker
    [root@VM_0_2_centos ~]#systemctl enable docker
    

    8.配置镜像加速器

    你可以选择阿里云加速器,DaoCloud加速器等Docker 版本在 1.12 或更高

    修改 /etc/docker/daemon.json 文件并添加上 registry-mirrors 键值。

    [root@VM_0_2_centos ~]#vim /etc/docker/daemon.json 
    {
      "registry-mirrors": ["https://docker.mirrors.ustc.edu.cn/"]
    }
    [root@VM_0_2_centos ~]#systemctl daemon-reload
    [root@VM_0_2_centos ~]#systemctl restart docker
    

    9.验证是否安装成功(有client和service两部分表示docker安装启动都成功)

    [root@VM_0_2_centos ~]#docker version 
    
  • 相关阅读:
    三分法
    string常用函数的整理
    一句话 讲解 kmp的 next 数组 看不懂的 直接来掐死我吧
    http://www.codeforces.com/contest/703/problem/D D. Mishka and Interesting sum (莫队的TLE)
    Codeforces Round #365 (Div. 2) C
    数论
    默慈金数
    转载:HTTP 请求头中的 X-Forwarded-For
    Glusterfs volume 的三种挂载方式
    GlusterFS 配置及使用
  • 原文地址:https://www.cnblogs.com/51fly/p/11942140.html
Copyright © 2011-2022 走看看