• dive 方便的观察容器各层信息的工具


    dive 是一个方便的观察容器各层信息的工具,同时也集成了容器构建命令,方便我们在构建容器
    镜像的同时查询镜像各层的变动信息

    安装

    mac 系统,可以按照自己的系统选择安装方式

    wget https://github.com/wagoodman/dive/releases/download/v0.6.0/dive_0.6.0_darwin_amd64.tar.gz
    解压,并配置系统环境变量

    使用

    • 包含的命令
    dive --help
    This tool provides a way to discover and explore the contents of a docker image. Additionally the tool estimates
    the amount of wasted space and identifies the offending files from the image.
    
    Usage:
      dive [IMAGE] [flags]
      dive [command]
    
    Available Commands:
      build Builds and analyzes a docker image from a Dockerfile (this is a thin wrapper for the `docker build` command).
      help Help about any command
      version print the version number and exit (also --version)
    
    Flags:
          --ci-config string If CI=true in the environment, use the given yaml to drive validation rules. (default ".dive-ci")
          --config string config file (default is $HOME/.dive.yaml, ~/.config/dive.yaml, or $XDG_CONFIG_HOME/dive.yaml)
      -h, --help help for dive
      -j, --json string Skip the interactive TUI and write the layer analysis statistics to a given file.
      -v, --version display version number
    
    Use "dive [command] --help" for more information about a command.
    • 查看nginx 构建信息
    dive nginx
    • 效果

    说明

    我们可以同时在构建的时候使用dive 帮忙我们查看每层镜像的变动信息,方便进行容器镜像的优化调整,使用dive build -t <imagetag> . 命令
    同时我们也可以使用docker in docker 的模式做为ci/cd 的一部分,方便进行监控容器信息

    参考资料

    https://github.com/wagoodman/dive

  • 相关阅读:
    单位rem 触屏适配总结
    汉字转拼音插件:LM-PinYin.js
    PngOptimizer PNG压缩工具
    H5微信场景应用 audio模块
    LM_ReadImgMode.js PC单页轮播读图模式组件,零依赖!
    js中的eval方法
    IE6利用iframe遮挡 弹层 select
    H5 video安卓默认点击不能全屏播放解决办法
    JS正则截取两个字符串之间的字符串
    定宽320 缩放适配手机屏幕
  • 原文地址:https://www.cnblogs.com/rongfengliang/p/10396021.html
Copyright © 2020-2023  润新知