Skip to content

Commit

Permalink
example: fix npm-lock
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <[email protected]>
  • Loading branch information
crazy-max committed Dec 10, 2024
1 parent 18d6278 commit 125506b
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 20 deletions.
3 changes: 2 additions & 1 deletion examples/npm-lock/.dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/build/
/build/
/node_modules/
1 change: 1 addition & 0 deletions examples/npm-lock/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
10 changes: 7 additions & 3 deletions examples/npm-lock/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1

# Copyright 2022 buildkit-syft-scanner authors
# Copyright 2024 buildkit-syft-scanner authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -14,6 +14,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM scratch
FROM scratch AS base
COPY package-lock.json .
COPY <<EOF /empty
EOF

COPY package-lock.json /package-lock.json
FROM scratch
COPY --from=base /empty /
14 changes: 14 additions & 0 deletions examples/npm-lock/checks/sbom-base.spdx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"_type": "https://in-toto.io/Statement/v0.1",
"predicateType": "https://spdx.dev/Document",
"predicate": {
"SPDXID": "SPDXRef-DOCUMENT",
"name": "sbom-base",
"packages": [
{
"SPDXID": "=package",
"name": "lodash"
}
]
}
}
12 changes: 1 addition & 11 deletions examples/npm-lock/checks/sbom.spdx.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,6 @@
"predicateType": "https://spdx.dev/Document",
"predicate": {
"SPDXID": "SPDXRef-DOCUMENT",
"name": "sbom",
"packages": [
{
"SPDXID": "=package",
"name": "lodash"
},
{
"SPDXID": "=package",
"name": "npm"
}
]
"name": "sbom"
}
}
8 changes: 3 additions & 5 deletions examples/npm-lock/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions examples/npm-lock/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "npm-lock",
"version": "1.0.0",
"description": "BuildKit Syft Scanner",
"dependencies": {
"lodash": "^4.17.21"
}
}

0 comments on commit 125506b

Please sign in to comment.