容器镜像层分析与体积优化
dive 检查镜像的每一层、文件增删和浪费空间,帮助定位体积膨胀和构建缓存问题。它分析的是静态镜像内容,不是运行时行为或安全漏洞。
dive nginx:latest
dive registry.example.com/app:1.0
dive --ci nginx:latest
dive --json app.tar
dive --source docker-archive app.tar
dive --source podman nginx:latest
.dive-ci:
rules:
lowestEfficiency: 0.90
highestWastedBytes: 20MB
highestUserWastedPercent: 0.15
--ci 只按阈值返回结果,不提供交互界面;先本地跑一遍看细节。.dive-ci 的阈值要按项目基线设定;太严会让正常构建失败。合上页面,先回答,再展开对照。
dive --ci 和本地交互模式有什么区别?--ci 只按阈值返回结果,不提供交互界面;应先本地跑一遍看细节。
小程序版
微信扫码,随时查命令