From 585bff28fe5ec8447afa666f930e52692b383d6d Mon Sep 17 00:00:00 2001 From: Haiko Schol Date: Thu, 14 Mar 2024 18:47:05 +0700 Subject: [PATCH] feat(docker): Add Bazel to runtime image and env path Signed-off-by: Haiko Schol --- Dockerfile | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Dockerfile b/Dockerfile index e65310703e364..11691fd5ea0d6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -564,3 +564,18 @@ ENV PATH=$PATH:$HASKELL_HOME/bin COPY --from=haskell /opt/haskell /opt/haskell RUN syft /opt/haskell -o spdx-json --file /usr/share/doc/ort/ort-haskell.spdx.json + +# Bazel +ENV BAZEL_HOME=/opt/bazel + +RUN mkdir -p $BAZEL_HOME/bin \ + && if [ "$(arch)" = "aarch64" ]; then \ + curl -L https://github.com/bazelbuild/bazel/releases/download/7.1.0/bazel-7.1.0-linux-arm64 -o $BAZEL_HOME/bin/bazel; \ + else \ + curl -L https://github.com/bazelbuild/bazel/releases/download/7.1.0/bazel-7.1.0-linux-x86_64 -o $BAZEL_HOME/bin/bazel; \ + fi \ + && chmod a+x $BAZEL_HOME/bin/bazel + +ENV PATH=$PATH:$BAZEL_HOME/bin + +RUN syft $BAZEL_HOME -o spdx-json --file /usr/share/doc/ort/ort-bazel.spdx.json