util/docker: Replace use of sed with build args
Change-Id: I9ab101e06ed670dfe6802f9bd0df128d056446db Signed-off-by: Tim Crawford <tcrawford@system76.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/77540 Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de> Reviewed-by: Martin L Roth <gaumless@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
@ -1,19 +1,16 @@
|
||||
# This dockerfile is not meant to be used directly by docker. The
|
||||
# {{}} variables are replaced with values by the makefile. Please generate
|
||||
# the docker image for this file by running:
|
||||
# Generate the docker image for this file by running:
|
||||
#
|
||||
# make coreboot-sdk
|
||||
#
|
||||
# Variables can be updated on the make command line or left blank to use
|
||||
# the default values set by the makefile.
|
||||
#
|
||||
# SDK_VERSION is used to name the version of the coreboot sdk to use.
|
||||
# Typically, this corresponds to the toolchain version. This
|
||||
# is used to identify this docker image.
|
||||
# DOCKER_COMMIT is the coreboot Commit-ID to build the toolchain from.
|
||||
|
||||
FROM debian:sid AS coreboot-sdk
|
||||
|
||||
# The coreboot Commit-ID to build the toolchain from.
|
||||
ARG DOCKER_COMMIT
|
||||
# The version of the coreboot sdk to use. Typically, this corresponds to the
|
||||
# toolchain version. This is used to identify this docker image.
|
||||
ARG SDK_VERSION
|
||||
ARG CROSSGCC_PARAM
|
||||
|
||||
RUN \
|
||||
useradd -p locked -m coreboot && \
|
||||
apt-get -qq update && \
|
||||
@ -93,12 +90,12 @@ RUN \
|
||||
cd /tmp && \
|
||||
git clone https://review.coreboot.org/coreboot && \
|
||||
cd coreboot && \
|
||||
git checkout {{DOCKER_COMMIT}}; \
|
||||
if echo {{CROSSGCC_PARAM}} | grep -q ^all; then \
|
||||
git checkout ${DOCKER_COMMIT}; \
|
||||
if echo ${CROSSGCC_PARAM} | grep -q ^all; then \
|
||||
make -C /tmp/coreboot/util/crossgcc/ build_clang \
|
||||
BUILD_LANGUAGES=c,ada CPUS=$(nproc) DEST=/opt/xgcc; \
|
||||
fi; \
|
||||
make -C /tmp/coreboot/util/crossgcc/ {{CROSSGCC_PARAM}} \
|
||||
make -C /tmp/coreboot/util/crossgcc/ ${CROSSGCC_PARAM} \
|
||||
BUILD_LANGUAGES=c,ada CPUS=$(nproc) DEST=/opt/xgcc && \
|
||||
rm -rf /tmp/coreboot
|
||||
|
||||
@ -107,12 +104,12 @@ RUN mkdir /home/coreboot/.ccache && \
|
||||
mkdir /home/coreboot/cb_build && \
|
||||
chown coreboot:coreboot /home/coreboot/cb_build && \
|
||||
echo "export PATH=$PATH:/opt/xgcc/bin" >> /home/coreboot/.bashrc && \
|
||||
echo "export SDK_VERSION={{SDK_VERSION}}" >> /home/coreboot/.bashrc && \
|
||||
echo "export SDK_COMMIT={{DOCKER_COMMIT}}" >> /home/coreboot/.bashrc
|
||||
echo "export SDK_VERSION=${SDK_VERSION}" >> /home/coreboot/.bashrc && \
|
||||
echo "export SDK_COMMIT=${DOCKER_COMMIT}" >> /home/coreboot/.bashrc
|
||||
|
||||
ENV PATH $PATH:/opt/xgcc/bin
|
||||
ENV SDK_VERSION={{SDK_VERSION}}
|
||||
ENV SDK_COMMIT={{DOCKER_COMMIT}}
|
||||
ENV SDK_VERSION=${SDK_VERSION}
|
||||
ENV SDK_COMMIT=${DOCKER_COMMIT}
|
||||
USER coreboot
|
||||
|
||||
FROM coreboot-sdk
|
||||
|
Reference in New Issue
Block a user