Skip to content

Commit

Permalink
Added inline SBOM for binaries downloaded outside package manager
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurentGoderre committed Oct 4, 2023
1 parent 591d3dd commit 6f4ae83
Show file tree
Hide file tree
Showing 15 changed files with 57 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.jq-template.awk
template-helper-functions.jq
4 changes: 3 additions & 1 deletion 11/alpine3.17/Dockerfile

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

4 changes: 3 additions & 1 deletion 11/alpine3.18/Dockerfile

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

4 changes: 3 additions & 1 deletion 12/alpine3.17/Dockerfile

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

4 changes: 3 additions & 1 deletion 12/alpine3.18/Dockerfile

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

4 changes: 3 additions & 1 deletion 13/alpine3.17/Dockerfile

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

4 changes: 3 additions & 1 deletion 13/alpine3.18/Dockerfile

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

4 changes: 3 additions & 1 deletion 14/alpine3.17/Dockerfile

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

4 changes: 3 additions & 1 deletion 14/alpine3.18/Dockerfile

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

4 changes: 3 additions & 1 deletion 15/alpine3.17/Dockerfile

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

4 changes: 3 additions & 1 deletion 15/alpine3.18/Dockerfile

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

4 changes: 3 additions & 1 deletion 16/alpine3.17/Dockerfile

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

4 changes: 3 additions & 1 deletion 16/alpine3.18/Dockerfile

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

16 changes: 15 additions & 1 deletion Dockerfile-alpine.template
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{ include "template-helper-functions" }}
FROM alpine:{{ env.variant | ltrimstr("alpine") }}

# 70 is the standard uid/gid for "postgres" in Alpine
Expand Down Expand Up @@ -164,7 +165,20 @@ RUN set -eux; \
/usr/local/share/doc \
/usr/local/share/man \
; \
\
echo '{{
{
name: "postgres",
version: .version,
params: {
os_name: "alpine",
os_version: env.variant | ltrimstr("alpine"),
},
licenses: [
"PostgreSQL"
]
} | sbom | tostring
}}' > /usr/local/postgres.spdx.json \
; \
postgres --version

# make the sample config easier to munge (and "correct by default")
Expand Down
5 changes: 5 additions & 0 deletions apply-templates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ elif [ "$BASH_SOURCE" -nt "$jqt" ]; then
wget -qO "$jqt" 'https://github.com/docker-library/bashbrew/raw/9f6a35772ac863a0241f147c820354e4008edf38/scripts/jq-template.awk'
fi

jqf='template-helper-functions.jq'
if [ "$BASH_SOURCE" -nt "$jqf" ]; then
wget -qO "$jqf" 'https://github.com/docker-library/bashbrew/raw/master/scripts/template-helper-functions.jq'
fi

if [ "$#" -eq 0 ]; then
versions="$(jq -r 'keys | map(@sh) | join(" ")' versions.json)"
eval "set -- $versions"
Expand Down

0 comments on commit 6f4ae83

Please sign in to comment.