gtp*_*dqc 5 git continuous-integration docker
当使用docker:24.0.0-dindwith docker:24.0.0-cli, todocker build而不先安装 Git 时,我们会收到警告:
警告:buildx:系统中未找到 git。构建未捕获当前提交信息
如果在运行之前安装了 Git,会捕获哪些信息docker build?
# Git is not installed at this point
# "WARNING: buildx: git was not found in the system. Current commit information was not captured by the build"
docker build -t "$REGISTRY/without-git" .
apk add git
# Git installed. No more buildx warning.
docker build -t "$REGISTRY/with-git" .
docker push "$REGISTRY/without-git"
docker push "$REGISTRY/with-git"
# stdout: null
docker buildx imagetools inspect "$REGISTRY/without-git" --format "{{ json .Provenance.SLSA }}"
# stdout: null
docker buildx imagetools inspect "$REGISTRY/with-git" --format "{{ json .Provenance.SLSA }}"
# Explicit attestation, also stdout: null
docker buildx build -t "$CI_REGISTRY_IMAGE/with-git-attested" --attest type=provenance,mode=max .
docker push "$REGISTRY/with-git-attested"
docker buildx imagetools inspect "$REGISTRY/with-git-attested" --format "{{ json .Provenance.SLSA }}"
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2762 次 |
| 最近记录: |