mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-06 04:26:59 +02:00
This change introduces a containerised SDK as a replacement for cork SDK operations. It also simplifies versioning by removing the need for manifest repos as well as usage of the "repo" tool by use of git submodules for coreos-overlay and portage-stable. The following feature scripts are added: - run_sdk_container: Run a command in an SDK container, using the current scripts repo + ebuild submodules. current scripts repo + ebuild submodules. - bootstrap_sdk_container / build_sdk_container_image: Bootstrap a new SDK and create an SDK container from the resulting SDK tarball. The following additions have been made to SDK scripts: - setup_board: add --pkgdir parameter to use a custom binary packge directory. Signed-off-by: Thilo Fromm <thilo@kinvolk.io>
30 lines
805 B
Docker
30 lines
805 B
Docker
ARG VERSION
|
|
|
|
FROM flatcar-sdk-build:${VERSION} as meta
|
|
ARG RMARCH
|
|
ARG RMCROSS
|
|
|
|
RUN if [ -n "$RMCROSS" ]; then \
|
|
sudo crossdev --clean --force "$RMCROSS"; \
|
|
fi
|
|
|
|
RUN if [ -n "$RMARCH" ]; then \
|
|
sudo rm -rf /build/$RMARCH; \
|
|
sudo rm -f /usr/local/bin/*-$RMARCH; \
|
|
fi
|
|
|
|
# Note: .repo/manifests/version.txt will survive this. That's intended.
|
|
RUN sudo rm -rf /mnt/host/source/*
|
|
|
|
FROM scratch
|
|
|
|
COPY --from=meta / /
|
|
COPY --from=meta --chown=sdk:sdk /home/sdk /home/sdk
|
|
RUN chown -R sdk:sdk /mnt/host/source
|
|
|
|
# This is not used when starting the container via ./run_sdk_container
|
|
# but it's useful fir standalone container use.
|
|
RUN mkdir -p /mnt/host/source/src/scripts
|
|
COPY --chown=sdk:sdk sdk_lib/sdk_init_selfcontained.sh /mnt/host/source/src/
|
|
ENTRYPOINT /home/sdk/sdk_entry.sh
|