zoukankan      html  css  js  c++  java
  • docker-compose

    Install Docker Compose

    1. Official Installation Documentation

    #sudo curl -L "https://github.com/docker/compose/releases/download/1.29.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
    curl -L https://get.daocloud.io/docker/compose/releases/download/1.24.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
    sudo chmod +x /usr/local/bin/docker-compose 
    sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
     
    docker-compose -v
    # docker-compose version 1.24.0, build 0aa59064
    

      

    2. use pip to install

    pip3 install docker-compose==
    
    pip3 install docker-compose==1.28.6
    
    #docker-compose -v
    docker-compose version 1.28.6, build unknown

     

    Use docker-compose

    [0 root@vps /apps/docker_compose] #ss -ntl
    State       Recv-Q Send-Q                        Local Address:Port                                       Peer Address:Port
    LISTEN      0      128                                       *:22                                                    *:*
    LISTEN      0      128                                    [::]:22                                                 [::]:*
    [0 root@vps /apps/docker_compose] #cat docker-compose.yml
    service-nginx-web:
      image: nginx:latest
      container_name: nginx-web
      restart: always
      volumes:
      - /data/nginx:/usr/share/nginx/html/
      expose:
      - 80
      - 443
      ports:
      - "80:80"
      - "443:443"
       
    service-tomcat-app:
      image: tomcat:latest
      container_name: tomcat-app
      expose:
      - 8080
      ports:
      - "8088:8080"
    [0 root@vps /apps/docker_compose] #docker-compose up -d
    Pulling service-nginx-web (nginx:latest)...
    latest: Pulling from library/nginx
    a076a628af6f: Already exists
    0732ab25fa22: Pull complete
    d7f36f6fe38f: Pull complete
    f72584a26f32: Pull complete
    7125e4df9063: Pull complete
    Digest: sha256:10b8cc432d56da8b61b070f4c7d2543a9ed17c2b23010b43af434fd40e2ca4aa
    Status: Downloaded newer image for nginx:latest
    Creating nginx-web  ... done
    Creating tomcat-app ... done
    [0 root@vps /apps/docker_compose] #ss -ntl
    State       Recv-Q Send-Q                        Local Address:Port                                       Peer Address:Port
    LISTEN      0      128                                       *:8088                                                  *:*
    LISTEN      0      128                                       *:443                                                   *:*
    LISTEN      0      128                                       *:80                                                    *:*
    LISTEN      0      128                                       *:22                                                    *:*
    LISTEN      0      128                                    [::]:22                                                 [::]:*
    
    [0 root@vps /apps/docker_compose] # docker-compose up -d --scale service-tomcat-app=2
    
    [0 root@vps /apps/docker_compose] #docker-compose down
    Stopping tomcat-app ... done
    Stopping nginx-web ... done
    Removing tomcat-app ... done
    Removing nginx-web ... done
    [0 root@vps /apps/docker_compose] #ss -ntl
    State Recv-Q Send-Q Local Address:Port Peer Address:Port
    LISTEN 0 128 *:22 *:*
    LISTEN 0 128 [::]:22 [::]:*
    

      

      

     

  • 相关阅读:
    深度学习之TensorFlow(一)——基本使用
    64位win10+cuda8.0+vs2013+cuDNN V5下Caffe的编译安装教程并配置matlab2014a 接口
    Win10+vs2012+cuda8.0的安装与配置
    图像处理与matlab实例之图像平滑(一)
    Windows下pycharm使用theano的方法
    Python中的支持向量机SVM的使用(有实例)
    混淆矩阵在Matlab中PRtools模式识别工具箱的应用
    模式识别与机器学习—bagging与boosting
    微服务架构下分布式事务解决方案——阿里GTS
    谈谈分布式事务
  • 原文地址:https://www.cnblogs.com/firewalld/p/14635757.html
Copyright © 2011-2022 走看看