Use latest version tools

This commit is contained in:
Baohua Yang
2026-01-12 09:02:39 -08:00
parent 43e12058eb
commit 24eb615f54
15 changed files with 49 additions and 56 deletions

View File

@@ -34,3 +34,13 @@ COPY --chown=10:11 files* /mydir/
```
如果源路径为文件夹复制的时候不是直接复制该文件夹而是将文件夹中的内容复制到目标路径
## 使用 `--link` 优化多阶段构建
BuildKit 可以使用 `--link` 选项来优化多阶段构建的性能使用 `--link` 文件会以独立层的形式添加无需依赖前序指令的结果
```docker
COPY --link --from=builder /app/dist /usr/share/nginx/html
```
这样可以更高效地利用缓存加速构建过程