zoukankan      html  css  js  c++  java
  • Docker在Centos 7上的部署

                                              Docker在Centos 7上的部署

     方法1---开启centos 7上自带的 extras YUM源,然后 yum install docker来安装

     安装前必须保证 Linux Kernel 要 3.10+, 用 uname -r 查这个参数

      [root@Franklin13 yum.repos.d]# cat CentOS-Base.repo |grep -a2 extras

    #additional packages that may be useful
    [extras]
    name=CentOS-$releasever - Extras
    mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra
    #baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
    enabled=1
    gpgcheck=1

     但 extras源里的 docker的版本很低,故采用如下方法:

    方法2 --- 通过下载清华大学上的开源 docker-ce YUM源来安装

     

     

     https://download.docker.com ---> 替换成  https://mirrors.tuna.tsinghua.edu.cn/docker-ce

     然后出现如下报错, 经查是清华大学的 URL地址写错了,docker-ce后少打了 /。之后修复成功

    yum-config-manager --save --setopt=docker-ce-stable.skip_if_unavailable=true

    failure: repodata/repomd.xml from docker-ce-stable: [Errno 256] No more mirrors to try.
    https://mirrors.tuna.tsinghua.edu.cn/docker-celinux/centos/7/x86_64/stable/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
    [root@Franklin13 ~]#

     ---整理相关报错详情

    --> Finished Dependency Resolution
    Error: Package: 2:container-selinux-2.107-3.el7.noarch (extras)
    Requires: selinux-policy >= 3.13.1-216.el7
    Installed: selinux-policy-3.13.1-166.el7.noarch (@anaconda)
    selinux-policy = 3.13.1-166.el7
    Error: Package: 2:container-selinux-2.107-3.el7.noarch (extras)
    Requires: selinux-policy-targeted >= 3.13.1-216.el7
    Installed: selinux-policy-targeted-3.13.1-166.el7.noarch (@anaconda)
    selinux-policy-targeted = 3.13.1-166.el7
    Error: Package: 2:container-selinux-2.107-3.el7.noarch (extras)
    Requires: selinux-policy-base >= 3.13.1-216.el7
    Installed: selinux-policy-targeted-3.13.1-166.el7.noarch (@anaconda)
    selinux-policy-base = 3.13.1-166.el7
    Available: selinux-policy-minimum-3.13.1-166.el7.noarch (c7-media)
    selinux-policy-base = 3.13.1-166.el7
    Available: selinux-policy-mls-3.13.1-166.el7.noarch (c7-media)
    selinux-policy-base = 3.13.1-166.el7
    You could try using --skip-broken to work around the problem
    You could try running: rpm -Va --nofiles --nodigest
    [root@Franklin13 ~]#
    [root@Franklin13 ~]# yum update selinux-policy
    Loaded plugins: fastestmirror, langpacks
    Loading mirror speeds from cached hostfile
    * extras: ftp.sjtu.edu.cn
    No packages marked for update
    [root@Franklin13 ~]#

    ----------------------故不得不求救于马云的阿里云镜像, 看如下 --------------------------

     https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

     

    [root@Franklin13 yum.repos.d]# yum install docker-ce (发现只有阿里云的 docker-ce源可以自动解决软件的依赖包问题 )

    Loaded plugins: fastestmirror, langpacks
    Loading mirror speeds from cached hostfile

     

    [root@Franklin13 yum.repos.d]# systemctl start docker.service
    [root@Franklin13 yum.repos.d]# docker version

     

    [root@Franklin13 yum.repos.d]# docker ps
    CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
    [root@Franklin13 yum.repos.d]#
    [root@Franklin13 yum.repos.d]# docker info
    Client:
    Debug Mode: false

    Server:
    Containers: 0
    Running: 0
    Paused: 0
    Stopped: 0
    Images: 0
    Server Version: 19.03.4
    Storage Driver: overlay2

  • 相关阅读:
    大组合取模之:1<=n<=m<=1e6,1<=p<=1e9
    大组合数取模之lucas定理模板,1<=n<=m<=1e9,1<p<=1e6,p必须为素数
    fzu2020( c(n,m)%p,其中n, m, p (1 <= m <= n <= 10^9, m <= 10^4, m < p < 10^9, p是素数) )
    lucas定理证明
    各类小公式
    x^a=b(mod c)求解x在[0,c-1]上解的个数模板+原根求法
    快速幂+乘模 模板
    hdu1695(容斥 or 莫比乌斯反演)
    poj1845(二分快速求等比数列模M和)
    2018JAVA面试题附答案
  • 原文地址:https://www.cnblogs.com/Franklinhong-No1/p/11785351.html
Copyright © 2011-2022 走看看