zoukankan      html  css  js  c++  java
  • dockerize 容器工具集基本使用

    基本功能:

     
    *  在启动的时候根据环境变量或者模版生成配置文锦啊
    *   多日志文件重定向到标准输入输出
    *   等待其他服务(tcp,http unix)起来之后在启动主进程
     
    1. 安装
    直接使用容器  jwilder/dockerize
    或者下载启动
    
    参考安装如下:
    ENV DOCKERIZE_VERSION v0.6.1
    wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz 
        && tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz 
     
    2. 基本使用
    a. 使用模版生成配置
    比如生成nginx 配置信息
    
    CMD dockerize -template /etc/nginx/nginx.tmpl:/etc/nginx/nginx.conf -stdout /var/log/nginx/access.log -stderr /var/log/nginx/error.log -wait tcp://web:8000 nginx
    
    b. 日志重定向
    
    dockerize -stdout info.log -stdout perf.log
    
    c. 等待依赖的服务正常启动
    
    dockerize -wait tcp://db:5432 -wait http://web:80 -wait file:///tmp/generated-file
    注意: 这个比较有用,尤其在使用docker-compose 构建应用的时候
    可选的参数有:
    -timeout
    -wait-retry-interval 
     
     
    3. 参考资料
    https://github.com/jwilder/dockerize
     
  • 相关阅读:
    MKMapViewDelegate
    MKMapView
    正则表达式随手篇
    c#多线程
    sql模糊查询效率
    c#多线程,进度条,实时给前台发送数据
    如何使用CocoaPods
    TabBar自定义方式(一)
    Spring MVC 学习资料
    优化Myeclipse10 Building Workspace速度慢等问题
  • 原文地址:https://www.cnblogs.com/rongfengliang/p/9026484.html
Copyright © 2011-2022 走看看