summaryrefslogtreecommitdiff
path: root/util/docker/coreboot-sdk
diff options
context:
space:
mode:
authorTim Crawford <tcrawford@system76.com>2023-08-29 08:29:40 -0600
committerFelix Held <felix-coreboot@felixheld.de>2023-09-07 13:36:20 +0000
commitd3a89cdb749aad5bc378552eee3167003219b62d (patch)
tree8c1ddf6983ecca6143842d36fb3b1d92e8d9a243 /util/docker/coreboot-sdk
parente352ea1ccd1292731ad80f3fa3152d39e15511ef (diff)
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>
Diffstat (limited to 'util/docker/coreboot-sdk')
-rw-r--r--util/docker/coreboot-sdk/Dockerfile33
1 files changed, 15 insertions, 18 deletions
diff --git a/util/docker/coreboot-sdk/Dockerfile b/util/docker/coreboot-sdk/Dockerfile
index eb725c9cbc..91543e9467 100644
--- a/util/docker/coreboot-sdk/Dockerfile
+++ b/util/docker/coreboot-sdk/Dockerfile
@@ -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