| 用途 | 禁用层缓存 |
|---|---|
| 语法 | docker build --no-cache -t 名称 . |
| 组合 | --pull 刷新基础镜像 |
示例
示例
docker build --no-cache --pull -t app/web:1.0 .依赖代理不稳定导致半成品缓存、或出现「本地好、线上坏」时,全量重建能排除缓存因素。
跳过所有层缓存重新执行每条指令,用于排除缓存干扰;与 --pull 组合可同时刷新基础镜像。
| 用途 | 禁用层缓存 |
|---|---|
| 语法 | docker build --no-cache -t 名称 . |
| 组合 | --pull 刷新基础镜像 |
docker build --no-cache --pull -t app/web:1.0 .