• CentOS Docker 安装


    前提条件

    目前,CentOS 仅发行版本中的内核支持 Docker。

    Docker 运行在 CentOS 7 上,要求系统为64位、系统内核版本为 3.10 以上。

    Docker 运行在 CentOS-6.5 或更高的版本的 CentOS 上,要求系统为64位、系统内核版本为 2.6.32-431 或者更高版本。

    image

    安装一些必要的系统工具

    yum install -y yum-utils device-mapper-persistent-data lvm2
    image

    添加软件源信息:

    yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
    
    
    更新 yum 缓存: yum makecache fast
    image

    安装 Docker-ce:

     yum -y install docker-ce
    --> Processing Dependency: libseccomp.so.2()(64bit) for package: 3:docker-ce-18.09.0-3.el7.x86_64
    --> Processing Dependency: libsystemd.so.0()(64bit) for package: 3:docker-ce-18.09.0-3.el7.x86_64
    ---> Package docker-ce-cli.x86_64 1:18.09.0-3.el7 will be installed
    --> Finished Dependency Resolution
    Error: Package: 3:docker-ce-18.09.0-3.el7.x86_64 (docker-ce-stable)
               Requires: libsystemd.so.0()(64bit)
    Error: Package: 3:docker-ce-18.09.0-3.el7.x86_64 (docker-ce-stable)
               Requires: container-selinux >= 2.9
    Error: Package: containerd.io-1.2.0-3.el7.x86_64 (docker-ce-stable)
               Requires: systemd
    Error: Package: 3:docker-ce-18.09.0-3.el7.x86_64 (docker-ce-stable)
               Requires: libseccomp.so.2()(64bit)
    Error: Package: 3:docker-ce-18.09.0-3.el7.x86_64 (docker-ce-stable)
               Requires: libc.so.6(GLIBC_2.17)(64bit)
    Error: Package: 3:docker-ce-18.09.0-3.el7.x86_64 (docker-ce-stable)
               Requires: systemd-units
    Error: Package: 3:docker-ce-18.09.0-3.el7.x86_64 (docker-ce-stable)
               Requires: libsystemd.so.0(LIBSYSTEMD_209)(64bit)
     You could try using --skip-broken to work around the problem
     You could try running: rpm -Va --nofiles --nodigest
    [root@computer7 ~]#
    
    解决方法:升级内核(带aufs模块)
    https://www.cnblogs.com/zhangzhen894095789/p/6641981.html?utm_source=itdadao&utm_medium=referral

    cd /etc/yum.repos.d

    wget http://www.hop5.in/yum/el6/hop5.repo

    yum install kernel-ml-aufs kernel-ml-aufs-devel

    image
    修改grub的主配置文件/etc/grub.conf,设置default=0,表示第一个title下的内容为默认启动的kernel(一般新安装的内核在第一个位置)。
    
    
    image
    重启系统,这时候你的内核就成功升级了。

    image

    查看内核是否支持aufs:

    grep aufs /proc/filesystems

    image

    首先关闭selinux:

    setenforce 0

    sed -i '/^SELINUX=/cSELINUX=disabled' /etc/selinux/config

      在Fedora EPEL源中已经提供了docker-io包,下载安装epel:

    rpm -ivh http://mirrors.sohu.com/fedora-epel/6/x86_64/epel-release-6-8.noarch.rpm

    sed -i 's/^mirrorlist=https/mirrorlist=http/' /etc/yum.repos.d/epel.repo

    image

     

    yum安装docker-io:

    yum -y install docker-io

    image

    service docker start

    image

    docker  --version

    image


    refer to : http://www.runoob.com/docker/centos-docker-install.html

  • 相关阅读:
    window.open打开新的独立页面
    域名如何添加解析?
    URL 链接中的 UTM参数何定义?
    学习总结【匿名函数,匿名自执行函数】
    CSS布局之Flex布局
    CSS布局之display: tables布局
    CSS里盒子模型中【margin垂直方向边界叠加】问题及解决方案
    Hibernate 事务管理
    Hibernate 二级缓存
    Hibernate c3p0的整合
  • 原文地址:https://www.cnblogs.com/ze-lin/p/10164258.html
Copyright © 2020-2023  润新知