[Sound-open-firmware] [PATCH 1/3] scripts: docker: simplify docker build
Xiuli Pan
xiuli.pan at linux.intel.com
Mon Jun 11 18:01:48 CEST 2018
From: Pan Xiuli <xiuli.pan at linux.intel.com>
Merege commands to reduce layers and remove some useless layers.
Signed-off-by: Pan Xiuli <xiuli.pan at linux.intel.com>
---
scripts/README.docker | 2 ++
scripts/docker_build/Dockerfile | 24 ++++++------------------
2 files changed, 8 insertions(+), 18 deletions(-)
diff --git a/scripts/README.docker b/scripts/README.docker
index e2f189f..468ae25 100644
--- a/scripts/README.docker
+++ b/scripts/README.docker
@@ -22,6 +22,8 @@ cd scripts/docker_build
After the container is built, it can be used to run the scripts.
To build for baytrail:
+./scripts/docker-run.sh ./scripts/xtensa-build-all.sh -l byt
+or (may need password test0000 for rimage install)
./scripts/docker-run.sh ./scripts/xtensa-build-all.sh byt
To rebuild the topology in soft.git:
diff --git a/scripts/docker_build/Dockerfile b/scripts/docker_build/Dockerfile
index 8dede3c..cf55ab1 100644
--- a/scripts/docker_build/Dockerfile
+++ b/scripts/docker_build/Dockerfile
@@ -36,10 +36,8 @@ RUN apt-get -y update && \
gperf \
help2man \
libncurses5-dev \
- libncurses5-dev \
libssl-dev \
libtool \
- libtool \
libtool-bin \
pkg-config \
software-properties-common \
@@ -68,9 +66,9 @@ cd /root/alsa-build/alsa-lib && ./gitcompile && make install && \
cd /root/alsa-build/alsa-utils && ./gitcompile && make install && \
cd /root/ && rm -rf alsa-build
-RUN useradd --create-home -d /home/sof -u $UID -G sudo sof
-RUN echo "sof:test0000" | chpasswd
-RUN adduser sof sudo
+# Set up sof user
+RUN useradd --create-home -d /home/sof -u $UID -G sudo sof && \
+echo "sof:test0000" | chpasswd && adduser sof sudo
ENV HOME /home/sof
# pull all sof repositories that are needed
@@ -118,21 +116,11 @@ RUN for arch in byt hsw bxt cnl; do \
make distclean; \
done
-USER sof
-WORKDIR /home/sof/sof.git
-RUN ./autogen.sh
-RUN ./configure --enable-rimage
-RUN make
-USER root
-RUN make install
# Create direcroties for the host machines sof/soft directories to be mounted.
-USER sof
-RUN mkdir -p /home/sof/work/sof
-RUN mkdir -p /home/sof/work/soft
+RUN mkdir -p /home/sof/work/sof.git && \
+ mkdir -p /home/sof/work/soft.git
+
USER sof
WORKDIR /home/sof/work/sof.git/
-
-# Default to building all.
-CMD ./scripts/xtensa-build-all.sh
--
2.7.4
More information about the Sound-open-firmware
mailing list