美文网首页
docker-install && config

docker-install && config

作者: Aapon | 来源:发表于2017-12-08 13:33 被阅读29次

    docker install 指定版本

    添加docker 阿里云源

    1.cat >/etc/apt/sources.list.d/docker-main.list<<EOF
    deb [arch=amd64] http://mirrors.aliyun.com/docker-engine/apt/repo ubuntu-xenial main
    EOF
    
    2. Add Docker’s official GPG key
    
    curl -fsSL https://apt.dockerproject.org/gpg | sudo apt-key add -
    
    3. apt update
    
    apt-get update && apt-get upgrade -y 
    
    4. remove old docker  verison
    
    apt-get purge lxc-docker*
    
    5. list docker vesion
    
    apt-cache policy docker-engine 
    
    6. install docker version
    
    apt-get install -y docker-engine=17.03.0~ce-0~ubuntu-xenial
    

    docker config

    1. Docker Config Registry
    • vi /lib/systemd/system/docker.service 在ExecStart后面添加如下命令:--insecure-registry=172.0.0.1 此IP根据私有仓库调整
    • systemctl daemon-reload
    • systemctl restart docker
    1. Docker Config proxy
    • vi /lib/systemd/system/docker.service 在ExecStart后面添加如下命令:--registry-mirror=https://n9h3vi0d.mirror.aliyuncs.com
    • systemctl daemon-reload
    • systemctl restart docker
    1. Docker Root Dir Config
    • vi /etc/docker/daemon.json 如没此文件,创建,添加:
      {
      "graph": "/mnt/data-docker"
      }
    • systemctl daemon-reload
    • systemctl restart docker

    参考:
    https://docs.docker.com/
    https://www.xtplayer.cn/2017/02/2783

    相关文章

      网友评论

          本文标题:docker-install && config

          本文链接:https://www.haomeiwen.com/subject/blxeixtx.html