Skip to content

Commit

Permalink
Remove manual SBOMs
Browse files Browse the repository at this point in the history
Syft is now detecting OpenSSL and Erlanf binaries and rabbitmq erlang package
  • Loading branch information
LaurentGoderre committed May 1, 2024
1 parent d8d2d53 commit 0273b04
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 124 deletions.
8 changes: 1 addition & 7 deletions 3.12/alpine/Dockerfile

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

8 changes: 1 addition & 7 deletions 3.12/ubuntu/Dockerfile

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

8 changes: 1 addition & 7 deletions 3.13/alpine/Dockerfile

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

8 changes: 1 addition & 7 deletions 3.13/ubuntu/Dockerfile

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

45 changes: 1 addition & 44 deletions Dockerfile-alpine.template
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Alpine Linux is not officially supported by the RabbitMQ team -- use at your own risk!
{{ include ".template-helper-functions" }}
FROM alpine:{{ .alpine.version }} as build-base

RUN apk add --no-cache \
Expand Down Expand Up @@ -235,34 +234,7 @@ ENV ERLANG_INSTALL_PATH_PREFIX /opt/erlang
ENV OPENSSL_INSTALL_PATH_PREFIX /opt/openssl

COPY --from=erlang-builder $ERLANG_INSTALL_PATH_PREFIX $ERLANG_INSTALL_PATH_PREFIX
RUN echo '{{
{
name: "erlang",
version: .otp.version,
params: {
os_name: "alpine",
os_version: .alpine.version
},
licenses: [
"Apache-2.0"
]
} | sbom | tostring
}}' > $ERLANG_INSTALL_PATH_PREFIX/erlang.spdx.json

COPY --from=openssl-builder $OPENSSL_INSTALL_PATH_PREFIX $OPENSSL_INSTALL_PATH_PREFIX
RUN echo '{{
{
name: "openssl",
version: .openssl.version,
params: {
os_name: "alpine",
os_version: .alpine.version
},
licenses: [
"Apache-2.0"
]
} | sbom | tostring
}}' > $OPENSSL_INSTALL_PATH_PREFIX/openssl.spdx.json

ENV PATH $ERLANG_INSTALL_PATH_PREFIX/bin:$OPENSSL_INSTALL_PATH_PREFIX/bin:$PATH

Expand Down Expand Up @@ -361,22 +333,7 @@ RUN set -eux; \
su-exec rabbitmq rabbitmqctl list_ciphers; \
su-exec rabbitmq rabbitmq-plugins list; \
# no stale cookies
rm "$RABBITMQ_DATA_DIR/.erlang.cookie";\
\
echo '{{
{
name: "rabbitmq",
version: .version,
params: {
os_name: "alpine",
os_version: .alpine.version
},
licenses: [
"MPL-2.0",
"Apache-2.0"
]
} | sbom | tostring
}}' > $RABBITMQ_HOME/rabbitmq.spdx.json;
rm "$RABBITMQ_DATA_DIR/.erlang.cookie";

# Enable Prometheus-style metrics by default (https://github.com/docker-library/rabbitmq/issues/419)
RUN su-exec rabbitmq rabbitmq-plugins enable --offline rabbitmq_prometheus
Expand Down
45 changes: 1 addition & 44 deletions Dockerfile-ubuntu.template
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# The official Canonical Ubuntu Focal image is ideal from a security perspective,
# especially for the enterprises that we, the RabbitMQ team, have to deal with
{{ include ".template-helper-functions" }}
FROM ubuntu:{{ .ubuntu.version }} as build-base

ARG BUILDKIT_SBOM_SCAN_STAGE=true
Expand Down Expand Up @@ -234,34 +233,7 @@ FROM ubuntu:{{ .ubuntu.version }}
ENV ERLANG_INSTALL_PATH_PREFIX /opt/erlang
ENV OPENSSL_INSTALL_PATH_PREFIX /opt/openssl
COPY --from=erlang-builder $ERLANG_INSTALL_PATH_PREFIX $ERLANG_INSTALL_PATH_PREFIX
RUN echo '{{
{
name: "erlang",
version: .otp.version,
params: {
os_name: "ubuntu",
os_version: .ubuntu.version
},
licenses: [
"Apache-2.0"
]
} | sbom | tostring
}}' > $ERLANG_INSTALL_PATH_PREFIX/erlang.spdx.json

COPY --from=openssl-builder $OPENSSL_INSTALL_PATH_PREFIX $OPENSSL_INSTALL_PATH_PREFIX
RUN echo '{{
{
name: "openssl",
version: .openssl.version,
params: {
os_name: "ubuntu",
os_version: .ubuntu.version
},
licenses: [
"Apache-2.0"
]
} | sbom | tostring
}}' > $OPENSSL_INSTALL_PATH_PREFIX/openssl.spdx.json

ENV PATH $ERLANG_INSTALL_PATH_PREFIX/bin:$OPENSSL_INSTALL_PATH_PREFIX/bin:$PATH

Expand Down Expand Up @@ -355,22 +327,7 @@ RUN set -eux; \
gosu rabbitmq rabbitmqctl list_ciphers; \
gosu rabbitmq rabbitmq-plugins list; \
# no stale cookies
rm "$RABBITMQ_DATA_DIR/.erlang.cookie"; \
\
echo '{{
{
name: "rabbitmq",
version: .version,
params: {
os_name: "ubuntu",
os_version: .ubuntu.version
},
licenses: [
"MPL-2.0",
"Apache-2.0"
]
} | sbom | tostring
}}' > $RABBITMQ_HOME/rabbitmq.spdx.json
rm "$RABBITMQ_DATA_DIR/.erlang.cookie";

# Enable Prometheus-style metrics by default (https://github.com/docker-library/rabbitmq/issues/419)
RUN gosu rabbitmq rabbitmq-plugins enable --offline rabbitmq_prometheus
Expand Down
8 changes: 0 additions & 8 deletions apply-templates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,6 @@ 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
# https://github.com/docker-library/bashbrew/blob/master/scripts/template-helper-functions.jq
wget -qO "$jqf" 'https://github.com/docker-library/bashbrew/raw/5a86c34c5a3ef370b3d22c398d45ccab53bd64bd/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 0273b04

Please sign in to comment.