zoukankan      html  css  js  c++  java
  • 阿里云服务器安装Docker

    在阿里云服务器上安装Docker,服务器的系统是CentOS 7.6,

    所以可以看官方Docker安装文档:https://docs.docker.com/install/linux/docker-ce/centos/

    从阅读官网来看,首先若是没有较旧的Docker版本只需3步就可以完成Dockers的安装;但是有旧版本的话,需要先卸载旧版本

    $ sudo yum remove docker 
                  docker-client 
                  docker-client-latest 
                  docker-common 
                  docker-latest 
                  docker-latest-logrotate 
                  docker-logrotate 
                  docker-engine
    

    无旧版本时(3步)

    1.安装所需的软件包

    $ sudo yum install -y yum-utils 
      device-mapper-persistent-data 
      lvm2
    

    2.配置阿里云Docker Yum源(个人觉的好)

    $ sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
    

    3.安装最新版本的Docker

    $ sudo yum install docker-ce docker-ce-cli containerd.io
    

    这样之后就OK了,执行启动Docker的命令:systemctl start docker,然后走一波,完美!!

    注,重要的事情说三遍。大多数人的执行完第二步后,会出现以下错误 Loaded plugins: fastestmirror

    解决方法如下:
    1、

    # vi  /etc/yum/pluginconf.d/fastestmirror.conf
    
    enabled=0    //由 1 改成0 ,禁用该插件
    verbose=0
    always_print_best_host = true
    socket_timeout=3
    #  Relative paths are relative to the cachedir (and so works for users as well
    # as root).
    hostfilepath=timedhosts.txt
    maxhostfileage=10
    maxthreads=15
    #exclude=.gov, facebook
    #include_only=.nl,.de,.uk,.ie
    

    2、

    #vi /etc/yum.conf
    
    [main]
    cachedir=/var/cache/yum/$basearch/$releasever
    keepcache=0
    debuglevel=2
    logfile=/var/log/yum.log
    exactarch=1
    obsoletes=1
    gpgcheck=1
    plugins=1 #将plugins的值修改为0
    installonly_limit=5
    

    3、

    $ yum clean dbcache
    

    之后重新执行配置源和安装命令即可。

  • 相关阅读:
    ZOJ-2008-Invitation Cards(dijkstra)
    codeforce-191E-Thwarting Demonstrations(树状数组+二分+离散)
    hdu-4612-Warm up(边双连通分量--有重边)
    TypeError: only integer scalar arrays can be converted to a scalar index
    电脑开机黑屏解决方法
    python中list与数组
    cv2.line()函数
    python中的浅拷贝与深拷贝——copy()
    pycharm中使用cv2模块
    numpy.where用法
  • 原文地址:https://www.cnblogs.com/moonstars/p/12577375.html
Copyright © 2011-2022 走看看