zoukankan      html  css  js  c++  java
  • Docker 以及 docker-compose 的部署

    Docker部署

    方式一

     #下载软件源
     wget -O /etc/yum.repos.d/docker-ce.repo https://mirrors.ustc.edu.cn/docker-ce/linux/centos/docker-ce.repo
     sed -i 's#download.docker.com#mirrors.ustc.edu.cn/docker-ce#g' /etc/yum.repos.d/docker-ce.repo
     
     #安装
     yum install docker-ce -y
     
     #启动
     systemctl enable docker
     systemctl start docker

    方式二

     #安装一些必要的系统工具:
     sudo yum install -y yum-utils device-mapper-persistent-data lvm2
     
     #添加软件源信息:
     sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
     
     #更新 yum 缓存:
     sudo yum makecache fast
     
     #安装 Docker-ce:
     sudo yum -y install docker-ce
    
     #启动 Docker 后台服务
     sudo systemctl start docker
     sudo systemctl enable docker
    
     #测试运行 hello-world
     docker run hello-world

    方式三

     #更新yum包
     sudo yum update
     
     #执行 Docker 安装脚本。
     curl -fsSL https://get.docker.com -o get-docker.sh
     sudo sh get-docker.sh
     #执行这个脚本会添加 docker.repo 源并安装 Docker。
    
     #启动 Docker 进程
     sudo systemctl start docker
     sudo systemctl enable docker

    验证 docker 是否安装成功

    在容器中执行一个测试的镜像。

    sudo docker run hello-world
    docker ps

    docker-compose部署

    方式一

    curl -L https://github.com/docker/compose/releases/download/1.24.0-rc3/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
    chmod +x /usr/local/bin/docker-compose

    方式二

    yum update -y
    yum install docker epel-release python-pip -y
    pip install --upgrade pip
    pip install docker-compose

    docker加速

    参考docker.hub:https://www.daocloud.io/mirror

    curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://f1361db2.m.daocloud.io
    systemctl restart docker.service

    作者:HaydenGuo

    出处:https://www.cnblogs.com/ghl1024/

    每一个前十年都想不到后十年我会演变成何等模样,可知人生无常,没有什么规律,没有什么必然。

    只要我还对新鲜的知识、品格的改进、情感的扩张、有胃口,这日子就是值得度过的。

  • 相关阅读:
    RE
    【LeetCode】198. House Robber
    【LeetCode】053. Maximum Subarray
    【LeetCode】152. Maximum Product Subarray
    【LeetCode】238.Product of Array Except Self
    【LeetCode】042 Trapping Rain Water
    【LeetCode】011 Container With Most Water
    【LeetCode】004. Median of Two Sorted Arrays
    【LeetCode】454 4Sum II
    【LeetCode】259 3Sum Smaller
  • 原文地址:https://www.cnblogs.com/ghl1024/p/12080149.html
Copyright © 2011-2022 走看看