Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7171d52

Browse files
authored
fix: replace both colons and slashes in SBOM filename for Docker image (#16915)
This PR fixes the SBOM filename generation in the Docker build script toproperly handle image tags that contain slashes. The currentimplementation only replaces colons with underscores, but fails whenimage tags include slashes (common in registry paths).The fix updates the string replacement to handle both colons and slashesin the image tag when generating the SBOM filename.Change-Id: Ifd7bad6d165393e11202e5bf070a4cb26eaa6a6aSigned-off-by: Thomas Kosiewski <tk@coder.com>Signed-off-by: Thomas Kosiewski <tk@coder.com>
1 parent389af22 commit7171d52

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎scripts/build_docker.sh‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,14 +154,14 @@ if [[ "$push" == 1 ]]; then
154154
fi
155155

156156
log"--- Generating SBOM for Docker image ($image_tag)"
157-
syft"$image_tag" -o spdx-json>"${image_tag//:/_}.spdx.json"
157+
syft"$image_tag" -o spdx-json>"${image_tag//[:\/]/_}.spdx.json"
158158

159159
if [["$push"== 1 ]];then
160160
log"--- Attesting SBOM to Docker image for$arch ($image_tag)"
161161
COSIGN_EXPERIMENTAL=1 cosign clean"$image_tag"
162162

163163
COSIGN_EXPERIMENTAL=1 cosign attest --type spdxjson \
164-
--predicate"${image_tag//:/_}.spdx.json" \
164+
--predicate"${image_tag//[:\/]/_}.spdx.json" \
165165
--yes \
166166
"$image_tag"
167167
fi

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp