util/docker: Update coreboot-sdk consolidate coreboot build

Because docker saves a container for every run command, by breaking
the coreboot build into 3 commands, it greatly increased the size of
the docker containers needed.  When combined as one run command, the
coreboot repo that is downloaded, along with the coreboot test build
are deleted before the container is created.  Since those directories
are deleted in a later run command, they don't even make it into the
final container, and just force coreboot-sdk users to download extra
data for no reason.

While splitting the build may help with debugging failures when
creating the docker container, that debugging can be done locally by
splitting up a working copy.

Signed-off-by: Martin Roth <martin@coreboot.org>
Change-Id: Ia28ee4e22c0a76dc45343755c45678795308adca
Reviewed-on: https://review.coreboot.org/c/coreboot/+/46801
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
This commit is contained in:
Martin Roth 2020-10-25 15:16:00 -06:00 committed by Patrick Georgi
parent b86d2b0935
commit ebeec5aed3
1 changed files with 6 additions and 10 deletions

View File

@ -84,21 +84,17 @@ RUN \
&& ln -s /usr/bin/aclocal /usr/bin/aclocal-1.15 && ln -s /usr/bin/aclocal /usr/bin/aclocal-1.15
RUN \ RUN \
cd /root && \ cd /tmp && \
git clone https://review.coreboot.org/coreboot && \ git clone https://review.coreboot.org/coreboot && \
cd coreboot && \ cd coreboot && \
git checkout {{DOCKER_COMMIT}} git checkout {{DOCKER_COMMIT}}; \
RUN \
if echo {{CROSSGCC_PARAM}} | grep -q ^all; then \ if echo {{CROSSGCC_PARAM}} | grep -q ^all; then \
make -C/root/coreboot/util/crossgcc/ build_clang \ make -C /tmp/coreboot/util/crossgcc/ build_clang \
BUILD_LANGUAGES=c,ada CPUS=$(nproc) DEST=/opt/xgcc; \ BUILD_LANGUAGES=c,ada CPUS=$(nproc) DEST=/opt/xgcc; \
fi fi; \
make -C /tmp/coreboot/util/crossgcc/ {{CROSSGCC_PARAM}} \
RUN \
make -C/root/coreboot/util/crossgcc/ {{CROSSGCC_PARAM}} \
BUILD_LANGUAGES=c,ada CPUS=$(nproc) DEST=/opt/xgcc && \ BUILD_LANGUAGES=c,ada CPUS=$(nproc) DEST=/opt/xgcc && \
rm -rf /root/coreboot rm -rf /tmp/coreboot
RUN mkdir /home/coreboot/.ccache && \ RUN mkdir /home/coreboot/.ccache && \
chown coreboot:coreboot /home/coreboot/.ccache && \ chown coreboot:coreboot /home/coreboot/.ccache && \