Skip to content

Commit

Permalink
feat(docker): Add Bazel to runtime image and env path
Browse files Browse the repository at this point in the history
Signed-off-by: Haiko Schol <[email protected]>
  • Loading branch information
haikoschol committed Mar 19, 2024
1 parent 465099f commit 9368107
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,25 @@ RUN mkdir -p $DOTNET_HOME/bin \
FROM scratch AS dotnet
COPY --from=dotnetbuild /opt/dotnet /opt/dotnet

#------------------------------------------------------------------------
# BAZEL
FROM base as bazelbuild

ARG BAZEL_VERSION=7.0.1

ENV BAZEL_HOME=/opt/bazel

RUN mkdir -p $BAZEL_HOME/bin \
&& if [ "$(arch)" = "aarch64" ]; then \
curl -L https://github.com/bazelbuild/bazel/releases/download/$BAZEL_VERSION/bazel-$BAZEL_VERSION-linux-arm64 -o $BAZEL_HOME/bin/bazel; \
else \
curl -L https://github.com/bazelbuild/bazel/releases/download/$BAZEL_VERSION/bazel-$BAZEL_VERSION-linux-x86_64 -o $BAZEL_HOME/bin/bazel; \
fi \
&& chmod a+x $BAZEL_HOME/bin/bazel

FROM scratch as bazel
COPY --from=bazelbuild /opt/bazel /opt/bazel

#------------------------------------------------------------------------
# ORT
FROM base as ortbuild
Expand Down Expand Up @@ -564,3 +583,11 @@ 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
ENV PATH=$PATH:$BAZEL_HOME/bin

COPY --from=bazel $BAZEL_HOME $BAZEL_HOME

RUN syft $BAZEL_HOME -o spdx-json --file /usr/share/doc/ort/ort-bazel.spdx.json

0 comments on commit 9368107

Please sign in to comment.