• DockerSwarm+Dubbo镜像与部署相关命令与参数


    Docker 镜像

    一、容器转镜像
    docker commit <containerId> <image:tag>
    docker commit 3ffa4284ddca zookeeper:3.4.14
    
    二、镜像保存文件
    docker save zookeeper:3.4.14 > zookeeper_3.4.14.tar.gz
    
    三、Dockerfile参考
    FROM openjdk:8-jre
    MAINTAINER songxz
    WORKDIR /appADD ./ /app/ENV JAVA_OPTS "-Xms400m -Xmx3g"ENV spring.profiles.active prod
    ENV file.encoding UTF-8EXPOSE 8089EXPOSE 20889RUN chmod 777 /app/start.shENTRYPOINT ["/app/start.sh"]
    四、Dockerfile编译镜像
    docker build -f ./Dockerfile -t 127.0.0.1:2000/web:v20190416184152
    docker push 127.0.0.1:2000/web:v20190416184152
    
    五、运行镜像
    docker run -t -d --name="web" -p 8085:8085 -p 20885:20885 -e "DUBBO_IP_TO_REGISTRY=127.0.0.1" -e "DUBBO_PORT_TO_REGISTRY=20885"  -e "DUBBO_PORT_TO_BIND=20885" 127.0.0.1:2000/web:v20190416184152
    
    六、Stack
    version: '3.1'
    services:
      vpcs:
        image: 127.0.0.1:2000/web:v20190416184152 
        deploy:
          replicas: 5
          resources:
            limits: 
              cpus: "1"
              memory: 8G
          restart_policy:
            condition: on-failure
          placement:
            constraints:
              - node.labels.usage==web_vpc
        ports:
          - 8085:8085
          - 20885:20885
        environment:
          DUBBO_IP_TO_REGISTRY: 127.0.0.1
          DUBBO_PORT_TO_REGISTRY: 20885
          DUBBO_PORT_TO_BIND: 20885
     
    七、镜像打标签
    docker tag web:v20190416184152 127.0.0.1:2000/web:v20190416184152
    
    八、镜像推送
    docker push 127.0.0.1:2000/web:v20190416184152
  • 相关阅读:
    robotframework-ride1.7.3.1更新安装
    批量删除新浪微博
    Redis
    GET和POST两种基本请求方法的区别
    selenium2自动化测试实战--基于Python语言
    同步/异步/阻塞/非阻塞/BIO/NIO/AIO
    HTTP抓包实战
    LCT模板(BZOJ2631)
    树链剖分模板(BZOJ3083)
    凸包(BZOJ1069)
  • 原文地址:https://www.cnblogs.com/songxingzhu/p/10761997.html
Copyright © 2020-2023  润新知