diff --git a/.gitignore b/.gitignore index d548f66d..c8db931e 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .jq-template.awk +.template-helper-functions.jq diff --git a/1.10-rc/alpine3.17/Dockerfile b/1.10-rc/alpine3.17/Dockerfile index c82ff14e..6659369a 100644 --- a/1.10-rc/alpine3.17/Dockerfile +++ b/1.10-rc/alpine3.17/Dockerfile @@ -52,7 +52,9 @@ RUN set -eux; \ apk del --no-network .fetch-deps; \ \ # smoke test - julia --version + julia --version; \ + \ + echo '{"spdxVersion":"SPDX-2.3","SPDXID":"SPDXRef-DOCUMENT","name":"julia-sbom","packages":[{"name":"julia","versionInfo":"1.10.0-rc1","SPDXID":"SPDXRef-Package--julia","externalRefs":[{"referenceCategory":"PACKAGE-MANAGER","referenceType":"purl","referenceLocator":"pkg:generic/julia@1.10.0-rc1?os_name=alpine&os_version=3.17"}],"licenseDeclared":"MIT"}]}' > $JULIA_PATH/julia.spdx.json; COPY docker-entrypoint.sh /usr/local/bin/ ENTRYPOINT ["docker-entrypoint.sh"] diff --git a/1.10-rc/alpine3.18/Dockerfile b/1.10-rc/alpine3.18/Dockerfile index 97652b94..c280b7a9 100644 --- a/1.10-rc/alpine3.18/Dockerfile +++ b/1.10-rc/alpine3.18/Dockerfile @@ -52,7 +52,9 @@ RUN set -eux; \ apk del --no-network .fetch-deps; \ \ # smoke test - julia --version + julia --version; \ + \ + echo '{"spdxVersion":"SPDX-2.3","SPDXID":"SPDXRef-DOCUMENT","name":"julia-sbom","packages":[{"name":"julia","versionInfo":"1.10.0-rc1","SPDXID":"SPDXRef-Package--julia","externalRefs":[{"referenceCategory":"PACKAGE-MANAGER","referenceType":"purl","referenceLocator":"pkg:generic/julia@1.10.0-rc1?os_name=alpine&os_version=3.18"}],"licenseDeclared":"MIT"}]}' > $JULIA_PATH/julia.spdx.json; COPY docker-entrypoint.sh /usr/local/bin/ ENTRYPOINT ["docker-entrypoint.sh"] diff --git a/1.10-rc/bookworm/Dockerfile b/1.10-rc/bookworm/Dockerfile index c9633e3a..e2fa5c09 100644 --- a/1.10-rc/bookworm/Dockerfile +++ b/1.10-rc/bookworm/Dockerfile @@ -76,7 +76,9 @@ RUN set -eux; \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ \ # smoke test - julia --version + julia --version; \ + \ + echo '{"spdxVersion":"SPDX-2.3","SPDXID":"SPDXRef-DOCUMENT","name":"julia-sbom","packages":[{"name":"julia","versionInfo":"1.10.0-rc1","SPDXID":"SPDXRef-Package--julia","externalRefs":[{"referenceCategory":"PACKAGE-MANAGER","referenceType":"purl","referenceLocator":"pkg:generic/julia@1.10.0-rc1?os_name=debian&os_version=bookworm"}],"licenseDeclared":"MIT"}]}' > $JULIA_PATH/julia.spdx.json; COPY docker-entrypoint.sh /usr/local/bin/ ENTRYPOINT ["docker-entrypoint.sh"] diff --git a/1.10-rc/bullseye/Dockerfile b/1.10-rc/bullseye/Dockerfile index 73e58c3d..fba9c526 100644 --- a/1.10-rc/bullseye/Dockerfile +++ b/1.10-rc/bullseye/Dockerfile @@ -76,7 +76,9 @@ RUN set -eux; \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ \ # smoke test - julia --version + julia --version; \ + \ + echo '{"spdxVersion":"SPDX-2.3","SPDXID":"SPDXRef-DOCUMENT","name":"julia-sbom","packages":[{"name":"julia","versionInfo":"1.10.0-rc1","SPDXID":"SPDXRef-Package--julia","externalRefs":[{"referenceCategory":"PACKAGE-MANAGER","referenceType":"purl","referenceLocator":"pkg:generic/julia@1.10.0-rc1?os_name=debian&os_version=bullseye"}],"licenseDeclared":"MIT"}]}' > $JULIA_PATH/julia.spdx.json; COPY docker-entrypoint.sh /usr/local/bin/ ENTRYPOINT ["docker-entrypoint.sh"] diff --git a/1.6/alpine3.17/Dockerfile b/1.6/alpine3.17/Dockerfile index 5af3d1d4..bea20bca 100644 --- a/1.6/alpine3.17/Dockerfile +++ b/1.6/alpine3.17/Dockerfile @@ -52,7 +52,9 @@ RUN set -eux; \ apk del --no-network .fetch-deps; \ \ # smoke test - julia --version + julia --version; \ + \ + echo '{"spdxVersion":"SPDX-2.3","SPDXID":"SPDXRef-DOCUMENT","name":"julia-sbom","packages":[{"name":"julia","versionInfo":"1.6.7","SPDXID":"SPDXRef-Package--julia","externalRefs":[{"referenceCategory":"PACKAGE-MANAGER","referenceType":"purl","referenceLocator":"pkg:generic/julia@1.6.7?os_name=alpine&os_version=3.17"}],"licenseDeclared":"MIT"}]}' > $JULIA_PATH/julia.spdx.json; COPY docker-entrypoint.sh /usr/local/bin/ ENTRYPOINT ["docker-entrypoint.sh"] diff --git a/1.6/alpine3.18/Dockerfile b/1.6/alpine3.18/Dockerfile index 77ada642..05c297a3 100644 --- a/1.6/alpine3.18/Dockerfile +++ b/1.6/alpine3.18/Dockerfile @@ -52,7 +52,9 @@ RUN set -eux; \ apk del --no-network .fetch-deps; \ \ # smoke test - julia --version + julia --version; \ + \ + echo '{"spdxVersion":"SPDX-2.3","SPDXID":"SPDXRef-DOCUMENT","name":"julia-sbom","packages":[{"name":"julia","versionInfo":"1.6.7","SPDXID":"SPDXRef-Package--julia","externalRefs":[{"referenceCategory":"PACKAGE-MANAGER","referenceType":"purl","referenceLocator":"pkg:generic/julia@1.6.7?os_name=alpine&os_version=3.18"}],"licenseDeclared":"MIT"}]}' > $JULIA_PATH/julia.spdx.json; COPY docker-entrypoint.sh /usr/local/bin/ ENTRYPOINT ["docker-entrypoint.sh"] diff --git a/1.6/bookworm/Dockerfile b/1.6/bookworm/Dockerfile index ecfc53c9..676e237b 100644 --- a/1.6/bookworm/Dockerfile +++ b/1.6/bookworm/Dockerfile @@ -80,7 +80,9 @@ RUN set -eux; \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ \ # smoke test - julia --version + julia --version; \ + \ + echo '{"spdxVersion":"SPDX-2.3","SPDXID":"SPDXRef-DOCUMENT","name":"julia-sbom","packages":[{"name":"julia","versionInfo":"1.6.7","SPDXID":"SPDXRef-Package--julia","externalRefs":[{"referenceCategory":"PACKAGE-MANAGER","referenceType":"purl","referenceLocator":"pkg:generic/julia@1.6.7?os_name=debian&os_version=bookworm"}],"licenseDeclared":"MIT"}]}' > $JULIA_PATH/julia.spdx.json; COPY docker-entrypoint.sh /usr/local/bin/ ENTRYPOINT ["docker-entrypoint.sh"] diff --git a/1.6/bullseye/Dockerfile b/1.6/bullseye/Dockerfile index 7f3e9665..e703cb9d 100644 --- a/1.6/bullseye/Dockerfile +++ b/1.6/bullseye/Dockerfile @@ -80,7 +80,9 @@ RUN set -eux; \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ \ # smoke test - julia --version + julia --version; \ + \ + echo '{"spdxVersion":"SPDX-2.3","SPDXID":"SPDXRef-DOCUMENT","name":"julia-sbom","packages":[{"name":"julia","versionInfo":"1.6.7","SPDXID":"SPDXRef-Package--julia","externalRefs":[{"referenceCategory":"PACKAGE-MANAGER","referenceType":"purl","referenceLocator":"pkg:generic/julia@1.6.7?os_name=debian&os_version=bullseye"}],"licenseDeclared":"MIT"}]}' > $JULIA_PATH/julia.spdx.json; COPY docker-entrypoint.sh /usr/local/bin/ ENTRYPOINT ["docker-entrypoint.sh"] diff --git a/1.9/alpine3.17/Dockerfile b/1.9/alpine3.17/Dockerfile index 485cf44d..a1d03197 100644 --- a/1.9/alpine3.17/Dockerfile +++ b/1.9/alpine3.17/Dockerfile @@ -52,7 +52,9 @@ RUN set -eux; \ apk del --no-network .fetch-deps; \ \ # smoke test - julia --version + julia --version; \ + \ + echo '{"spdxVersion":"SPDX-2.3","SPDXID":"SPDXRef-DOCUMENT","name":"julia-sbom","packages":[{"name":"julia","versionInfo":"1.9.3","SPDXID":"SPDXRef-Package--julia","externalRefs":[{"referenceCategory":"PACKAGE-MANAGER","referenceType":"purl","referenceLocator":"pkg:generic/julia@1.9.3?os_name=alpine&os_version=3.17"}],"licenseDeclared":"MIT"}]}' > $JULIA_PATH/julia.spdx.json; COPY docker-entrypoint.sh /usr/local/bin/ ENTRYPOINT ["docker-entrypoint.sh"] diff --git a/1.9/alpine3.18/Dockerfile b/1.9/alpine3.18/Dockerfile index d1bb5364..6a64f709 100644 --- a/1.9/alpine3.18/Dockerfile +++ b/1.9/alpine3.18/Dockerfile @@ -52,7 +52,9 @@ RUN set -eux; \ apk del --no-network .fetch-deps; \ \ # smoke test - julia --version + julia --version; \ + \ + echo '{"spdxVersion":"SPDX-2.3","SPDXID":"SPDXRef-DOCUMENT","name":"julia-sbom","packages":[{"name":"julia","versionInfo":"1.9.3","SPDXID":"SPDXRef-Package--julia","externalRefs":[{"referenceCategory":"PACKAGE-MANAGER","referenceType":"purl","referenceLocator":"pkg:generic/julia@1.9.3?os_name=alpine&os_version=3.18"}],"licenseDeclared":"MIT"}]}' > $JULIA_PATH/julia.spdx.json; COPY docker-entrypoint.sh /usr/local/bin/ ENTRYPOINT ["docker-entrypoint.sh"] diff --git a/1.9/bookworm/Dockerfile b/1.9/bookworm/Dockerfile index 068dcbf6..07e419dd 100644 --- a/1.9/bookworm/Dockerfile +++ b/1.9/bookworm/Dockerfile @@ -80,7 +80,9 @@ RUN set -eux; \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ \ # smoke test - julia --version + julia --version; \ + \ + echo '{"spdxVersion":"SPDX-2.3","SPDXID":"SPDXRef-DOCUMENT","name":"julia-sbom","packages":[{"name":"julia","versionInfo":"1.9.3","SPDXID":"SPDXRef-Package--julia","externalRefs":[{"referenceCategory":"PACKAGE-MANAGER","referenceType":"purl","referenceLocator":"pkg:generic/julia@1.9.3?os_name=debian&os_version=bookworm"}],"licenseDeclared":"MIT"}]}' > $JULIA_PATH/julia.spdx.json; COPY docker-entrypoint.sh /usr/local/bin/ ENTRYPOINT ["docker-entrypoint.sh"] diff --git a/1.9/bullseye/Dockerfile b/1.9/bullseye/Dockerfile index 7b5b8c71..01496444 100644 --- a/1.9/bullseye/Dockerfile +++ b/1.9/bullseye/Dockerfile @@ -80,7 +80,9 @@ RUN set -eux; \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ \ # smoke test - julia --version + julia --version; \ + \ + echo '{"spdxVersion":"SPDX-2.3","SPDXID":"SPDXRef-DOCUMENT","name":"julia-sbom","packages":[{"name":"julia","versionInfo":"1.9.3","SPDXID":"SPDXRef-Package--julia","externalRefs":[{"referenceCategory":"PACKAGE-MANAGER","referenceType":"purl","referenceLocator":"pkg:generic/julia@1.9.3?os_name=debian&os_version=bullseye"}],"licenseDeclared":"MIT"}]}' > $JULIA_PATH/julia.spdx.json; COPY docker-entrypoint.sh /usr/local/bin/ ENTRYPOINT ["docker-entrypoint.sh"] diff --git a/Dockerfile-linux.template b/Dockerfile-linux.template index cd38530d..889195d3 100644 --- a/Dockerfile-linux.template +++ b/Dockerfile-linux.template @@ -1,3 +1,4 @@ +{{ include ".template-helper-functions" -}} {{ def is_alpine: env.variant | startswith("alpine") @@ -121,7 +122,21 @@ RUN set -eux; \ {{ ) end -}} \ # smoke test - julia --version + julia --version; \ + \ + echo {{ + { + name: "julia", + version: .version, + params: { + os_name: (if is_alpine then "alpine" else "debian" end), + os_version: env.variant | ltrimstr("alpine") + }, + licenses: [ + "MIT" + ] + } | sbom | tostring | @sh + }} > $JULIA_PATH/julia.spdx.json; COPY docker-entrypoint.sh /usr/local/bin/ ENTRYPOINT ["docker-entrypoint.sh"] diff --git a/apply-templates.sh b/apply-templates.sh index 78b7291b..c9af4bd4 100755 --- a/apply-templates.sh +++ b/apply-templates.sh @@ -11,6 +11,13 @@ 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 [ -n "${BASHBREW_SCRIPTS:-}" ]; then + jqf="$BASHBREW_SCRIPTS/template-helper-functions.jq" +elif [ "$BASH_SOURCE" -nt "$jqf" ]; then + wget -qO "$jqf" 'https://github.com/docker-library/bashbrew/raw/08c926140ad0af22de58c2a2656afda58082ba3e/scripts/template-helper-functions.jq' +fi + if [ "$#" -eq 0 ]; then versions="$(jq -r 'keys | map(@sh) | join(" ")' versions.json)" eval "set -- $versions"