| 用途 | 服务配置指纹 |
|---|---|
| 语法 | docker compose config --hash [服务…] 或 --hash='*' |
| 取值 | 哈希按服务映射输出 |
示例
示例
docker compose config --hash='*'
docker compose config --hash web api
docker compose config --hash='*' > /tmp/compose-hash.new && diff /tmp/compose-hash.old /tmp/compose-hash.new该能力在较新的 Compose v2 版本提供;老环境可退化为对 config 输出做 sha256sum 比对。