Skip to content

Commit ad50445

Browse files
authored
Merge pull request #83 from docker-library/revert-82-no-sbom-gha
Revert "Temporarily disable SBOMs on GHA"
2 parents a426e46 + 53ad607 commit ad50445

File tree

3 files changed

+2
-57
lines changed

3 files changed

+2
-57
lines changed

.test/meta-commands/out.sh

Lines changed: 2 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -137,57 +137,6 @@ jq -s '
137137
)
138138
' temp/index.json > temp/index.json.new
139139
mv temp/index.json.new temp/index.json
140-
# </build>
141-
# <push>
142-
crane push --index temp 'oisupport/staging-amd64:191402ad0feacf03daf9d52a492207e73ef08b0bd17265043aea13aa27e2bb3f'
143-
rm -rf temp
144-
# </push>
145-
146-
# busybox:1.36.1 [arm32v5]
147-
# <pull>
148-
149-
# </pull>
150-
# <build>
151-
export BASHBREW_CACHE="${BASHBREW_CACHE:-${XDG_CACHE_HOME:-$HOME/.cache}/bashbrew}"
152-
gitCache="$BASHBREW_CACHE/git"
153-
git init --bare "$gitCache"
154-
_git() { git -C "$gitCache" "$@"; }
155-
_git config gc.auto 0
156-
_commit() { _git rev-parse '7044abc7ee26712d998311b402b975124786e0cf^{commit}'; }
157-
if ! _commit &> /dev/null; then _git fetch 'https://github.com/docker-library/busybox.git' '7044abc7ee26712d998311b402b975124786e0cf:' || _git fetch 'refs/heads/dist-arm32v5:'; fi
158-
_commit
159-
mkdir temp
160-
_git archive --format=tar '7044abc7ee26712d998311b402b975124786e0cf:latest/glibc/arm32v5/' | tar -xvC temp
161-
jq -s '
162-
if length != 1 then
163-
error("unexpected '\''oci-layout'\'' document count: " + length)
164-
else .[0] end
165-
| if .imageLayoutVersion != "1.0.0" then
166-
error("unsupported imageLayoutVersion: " + .imageLayoutVersion)
167-
else . end
168-
' temp/oci-layout > /dev/null
169-
jq -s '
170-
if length != 1 then
171-
error("unexpected '\''index.json'\'' document count: " + length)
172-
else .[0] end
173-
| if .schemaVersion != 2 then
174-
error("unsupported schemaVersion: " + .schemaVersion)
175-
else . end
176-
| if .manifests | length != 1 then
177-
error("expected only one manifests entry, not " + (.manifests | length))
178-
else . end
179-
| .manifests[0] |= (
180-
if .mediaType != "application/vnd.oci.image.manifest.v1+json" then
181-
error("unsupported descriptor mediaType: " + .mediaType)
182-
else . end
183-
| if .size < 0 then
184-
error("invalid descriptor size: " + .size)
185-
else . end
186-
| del(.annotations, .urls)
187-
| .annotations = {"org.opencontainers.image.source":"https://github.com/docker-library/busybox.git","org.opencontainers.image.revision":"7044abc7ee26712d998311b402b975124786e0cf","org.opencontainers.image.created":"2024-02-28T00:44:18Z","org.opencontainers.image.version":"1.36.1","org.opencontainers.image.url":"https://hub.docker.com/_/busybox","com.docker.official-images.bashbrew.arch":"arm32v5","org.opencontainers.image.base.name":"scratch"}
188-
)
189-
' temp/index.json > temp/index.json.new
190-
mv temp/index.json.new temp/index.json
191140
# SBOM
192141
originalImageManifest="$(jq -r '.manifests[0].digest' temp/index.json)"
193142
SOURCE_DATE_EPOCH=1709081058 \
@@ -197,7 +146,7 @@ SOURCE_DATE_EPOCH=1709081058 \
197146
--build-arg BUILDKIT_DOCKERFILE_CHECK=skip=all \
198147
--sbom=generator="$BASHBREW_BUILDKIT_SBOM_GENERATOR" \
199148
--output 'type=oci,tar=false,dest=sbom' \
200-
--platform 'linux/arm/v5' \
149+
--platform 'linux/amd64' \
201150
--build-context "fake=oci-layout://$PWD/temp@$originalImageManifest" \
202151
- <<<'FROM fake'
203152
sbomIndex="$(jq -r '.manifests[0].digest' sbom/index.json)"
@@ -226,6 +175,6 @@ jq -r --argjson sbomManifestDesc "$sbomManifestDesc" '.manifests += [ $sbomManif
226175
mv temp/index.json.new temp/index.json
227176
# </build>
228177
# <push>
229-
crane push --index temp 'oisupport/staging-arm32v5:6dad189d12c5b50de48dab19c13869fdf25219dc430fc1d4c8a8dcc7bc893e69'
178+
crane push --index temp 'oisupport/staging-amd64:191402ad0feacf03daf9d52a492207e73ef08b0bd17265043aea13aa27e2bb3f'
230179
rm -rf temp
231180
# </push>

.test/meta-commands/test.jq

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
include "meta";
2-
include "doi"; # TODO remove this
32
[
43
first(.[] | select(normalized_builder == "buildkit")),
54
first(.[] | select(normalized_builder == "classic")),
65
first(.[] | select(normalized_builder == "oci-import")),
7-
first(.[] | select(normalized_builder == "oci-import" and build_should_sbom)), # TODO remove this
86
empty
97
]
108
| map(

doi.jq

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,6 @@ def build_should_sbom:
168168
| index($i)
169169
)
170170
)
171-
# TODO once we solve the issues with GHA and SBOM generation ("docker/scout-sbom-indexer" returning zero results), remove this added constraint
172-
and (.build.arch as $arch | ["amd64","i386","windows-amd64"] | index($arch) | not) # see also GHA arches in Jenkinsfile.trigger
173171
;
174172

175173
# input: "build" object (with "buildId" top level key)

0 commit comments

Comments
 (0)