Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added explicit attestation for Redis #382

Merged
merged 1 commit into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/*/**/Dockerfile linguist-generated
/*/**/docker-entrypoint.sh linguist-generated
/Dockerfile*.template linguist-language=Dockerfile
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 6.0/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 6.0/bookworm/Dockerfile

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

4 changes: 3 additions & 1 deletion 6.2/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 6.2/bookworm/Dockerfile

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

4 changes: 3 additions & 1 deletion 7.0/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 7.0/bookworm/Dockerfile

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

4 changes: 3 additions & 1 deletion 7.2/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 7.2/bookworm/Dockerfile

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

17 changes: 16 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") }}

# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added
Expand Down Expand Up @@ -89,7 +90,21 @@ RUN set -eux; \
apk del --no-network .build-deps; \
\
redis-cli --version; \
redis-server --version
redis-server --version; \
\
echo {{
{
name: "redis-server",
version: .version,
params: {
os_name: "alpine",
os_version: env.variant | ltrimstr("alpine")
},
licenses: [
"BSD-3-Clause"
]
} | sbom | tostring | @sh
}} > /usr/local/redis.spdx.json

RUN mkdir /data && chown redis:redis /data
VOLUME /data
Expand Down
17 changes: 16 additions & 1 deletion Dockerfile.template
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{ include ".template-helper-functions" -}}
FROM debian:{{ env.variant }}-slim

# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added
Expand Down Expand Up @@ -107,7 +108,21 @@ RUN set -eux; \
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
\
redis-cli --version; \
redis-server --version
redis-server --version; \
\
echo {{
{
name: "redis-server",
version: .version,
params: {
os_name: "debian",
os_version: env.variant
},
licenses: [
"BSD-3-Clause"
]
} | sbom | tostring | @sh
}} > /usr/local/redis.spdx.json

RUN mkdir /data && chown redis:redis /data
VOLUME /data
Expand Down
7 changes: 7 additions & 0 deletions apply-templates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,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"
Expand Down