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

posted on   荣锋亮  阅读(613)  评论(0编辑  收藏  举报

编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
历史上的今天:
2018-02-18 modsecurity3.0 nginx 安装
2016-02-18 Exploring the Angular 1.5 .component() method
2016-02-18 AngularJS 1.5.0-beta.2 and 1.4.8 have been released

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示