• centos6.7 安装docker


    更换yum源:

    先备份原先的文件
    mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak

    下载新的CentOS-Base.repo 到/etc/yum.repos.d/ 如下的源用一个就好,三条命令选其一

    //更新为阿里云的源
    wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
     
    //更新为163的源
    wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS6-Base-163.repo
     
    //更新为搜狐的源
    wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.sohu.com/help/CentOS-Base-sohu.repo

    清理缓存

    yum clean all   //清空yum缓存的软件包和header
    yum makecache   //把yum源中的包信息进行缓存

    安装docker

    安装依赖

    yum install libcgroup 

    下载docker并安装

    //注意当前所在目录
    
    wget https://yum.dockerproject.org/repo/main/centos/6/Packages/docker-engine-1.7.1-1.el6.x86_64.rpm
    rpm -ivh docker-engine-1.7.1-1.el6.x86_64.rpm 

    输入 docker --version

    启动docker

    配置文件

    ## /etc/sysconfig/docker
    other_args="--registry-mirror=https://87hqssex.mirror.aliyuncs.com"

    重新启动

    
    service docker start

    运行可能会出现错误

    FATA[0000] Error mounting devices cgroup: mountpoint for devices not found 

    这个错误为cgroup在宿主机上没有挂载。

    我们编辑挂载上去

    vi /etc/fstab
    #在结尾添加
    none        /sys/fs/cgroup        cgroup        defaults    0    0

    # docker-compose 

    1.7.1版本的docker只能安装1.5.2的docker-compose 

    wget https://github.com/docker/compose/releases/download/1.5.2/docker-compose-Linux-x86_64
    

      

  • 相关阅读:
    POJ 2234 Matches Game 尼姆博弈
    复杂问题的简单抽象:魔兽世界中的兔子们
    POJ 2368 巴什博奕
    POJ 1067 取石子游戏 威佐夫博弈
    Codeforces 704A Thor 队列模拟
    Codeforces 703B Mishka and trip
    P1447 [NOI2010]能量采集
    P2652 同花顺
    P2034 选择数字 / P2627 [USACO11OPEN]Mowing the Lawn G
    P2515 [HAOI2010]软件安装
  • 原文地址:https://www.cnblogs.com/erhao9767/p/11751068.html
Copyright © 2020-2023  润新知