mirror of
https://github.com/yeasy/docker_practice.git
synced 2026-08-12 01:17:42 +00:00
fix(content): harden Docker practice guide
This commit is contained in:
@@ -72,6 +72,8 @@ jobs:
|
||||
ghcr.io/${{ github.repository }}:latest
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
provenance: mode=max
|
||||
sbom: true
|
||||
```
|
||||
|
||||
关键说明:
|
||||
@@ -79,6 +81,7 @@ jobs:
|
||||
* `docker/login-action` 负责认证,支持 Docker Hub、GHCR、ECR 等主流 Registry。
|
||||
* `cache-from` / `cache-to` 使用 GitHub Actions 原生缓存(`type=gha`),无需额外配置即可加速增量构建。
|
||||
* 标签同时使用 commit hash 和 `latest`,兼顾版本追溯与部署便利。
|
||||
* `provenance: mode=max` 和 `sbom: true` 会把构建来源证明和 SBOM 附加到推送的镜像上;只做本地 `load: true` 的构建无法完整保留这些 attestation。
|
||||
|
||||
### 21.2.3 最佳实践
|
||||
|
||||
|
||||
Reference in New Issue
Block a user