Skip to content

Commit

Permalink
feat(docker): Add BitBake, the build tool for the Yocto project
Browse files Browse the repository at this point in the history
See [1]. This prepares for BitBake support in the analyzer.

[1]: https://docs.yoctoproject.org/bitbake/

Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
  • Loading branch information
sschuberth committed Sep 25, 2024
1 parent 9e30e9d commit fe667d2
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
26 changes: 26 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,17 @@ FROM scratch as bazel
COPY --from=bazelbuild /opt/bazel /opt/bazel
COPY --from=bazelbuild /opt/go/bin/buildozer /opt/go/bin/buildozer

#------------------------------------------------------------------------
# BITBAKE
FROM base as bitbakebuild

ARG BITBAKE_VERSION

RUN git clone --branch $BITBAKE_VERSION --depth 1 https://git.openembedded.org/bitbake /opt/bitbake

FROM scratch as bitbake
COPY --from=bitbakebuild /opt/bitbake /opt/bitbake

#------------------------------------------------------------------------
# ORT
FROM base as ortbuild
Expand Down Expand Up @@ -558,6 +569,21 @@ ENV PATH=$PATH:$BAZEL_HOME/bin
COPY --from=bazel $BAZEL_HOME $BAZEL_HOME
COPY --from=bazel --chown=$USER:$USER /opt/go/bin/buildozer /opt/go/bin/buildozer

# BitBake
ENV BITBAKE_HOME=/opt/bitbake
ENV PATH=$PATH:$BITBAKE_HOME/bin

COPY --from=bitbake $BITBAKE_HOME $BITBAKE_HOME

RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
sudo apt-get update && \
DEBIAN_FRONTEND=noninteractive sudo apt-get install -y --no-install-recommends \
bzip2 chrpath cpio diffstat gawk lz4 patch zstd \
&& sudo rm -rf /var/lib/apt/lists/*

RUN syft $BITBAKE_HOME -o spdx-json --output json=/usr/share/doc/ort/ort-bitbake.spdx.json

#------------------------------------------------------------------------
# Runtime container with minimal selection of supported package managers pre-installed.
FROM minimal-tools as minimal
Expand Down
1 change: 1 addition & 0 deletions docker/versions.dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ARG ANDROID_CMD_VERSION=11076708
ARG ASKALONO_VERSION=0.4.6
ARG BAZELISK_VERSION=1.20.0
ARG BITBAKE_VERSION=2.8.0
ARG BOWER_VERSION=1.8.14
ARG BOYTERLC_VERSION=1.3.1
ARG COCOAPODS_VERSION=1.15.2
Expand Down

0 comments on commit fe667d2

Please sign in to comment.