From 3e369d07d93169ee2896d2dda96a4b007cf43832 Mon Sep 17 00:00:00 2001 From: Fred Oh Date: Tue, 11 May 2021 10:55:44 -0700 Subject: [PATCH 1/5] docker-run.sh: set http/https proxy when docker run Use http/https proxys setting from the host. Signed-off-by: Fred Oh --- scripts/docker-run.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/docker-run.sh b/scripts/docker-run.sh index 3e6c5870e4b7..aa754391cad3 100755 --- a/scripts/docker-run.sh +++ b/scripts/docker-run.sh @@ -19,6 +19,8 @@ fi docker run -i -v "$(pwd)":/home/sof/work/sof.git \ --env CMAKE_BUILD_TYPE \ --env PRIVATE_KEY_OPTION \ + --env http_proxy="$http_proxy" \ + --env https_proxy="$https_proxy" \ --user "$(id -u)" \ $SOF_DOCKER_RUN \ sof "$@" From c17f818ae8cab686808a07d6530b67c72f5ff233 Mon Sep 17 00:00:00 2001 From: Fred Oh Date: Tue, 11 May 2021 11:11:14 -0700 Subject: [PATCH 2/5] docker-run.sh: minor alignment fix Removed extra spaces. Signed-off-by: Fred Oh --- scripts/docker-run.sh | 4 ++-- scripts/docker_build/sof_builder/Dockerfile | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/docker-run.sh b/scripts/docker-run.sh index aa754391cad3..db41fbcc8bfc 100755 --- a/scripts/docker-run.sh +++ b/scripts/docker-run.sh @@ -21,6 +21,6 @@ docker run -i -v "$(pwd)":/home/sof/work/sof.git \ --env PRIVATE_KEY_OPTION \ --env http_proxy="$http_proxy" \ --env https_proxy="$https_proxy" \ - --user "$(id -u)" \ + --user "$(id -u)" \ $SOF_DOCKER_RUN \ - sof "$@" + sof "$@" diff --git a/scripts/docker_build/sof_builder/Dockerfile b/scripts/docker_build/sof_builder/Dockerfile index 7b9c43637fa4..be19637a1c03 100644 --- a/scripts/docker_build/sof_builder/Dockerfile +++ b/scripts/docker_build/sof_builder/Dockerfile @@ -26,7 +26,7 @@ ENV https_proxy $host_https_proxy RUN apt-get -y update && \ apt-get install -y \ - autoconf \ + autoconf \ bison \ build-essential \ python3-pyelftools \ From 852d6c731ecd97de3d064854a443f1019179ae57 Mon Sep 17 00:00:00 2001 From: Fred Oh Date: Tue, 11 May 2021 11:23:25 -0700 Subject: [PATCH 3/5] Dockerfile: add vim and jed to apt install list Can't imagine editing files without vim or jed. Signed-off-by: Fred Oh --- scripts/docker_build/sof_builder/Dockerfile | 2 ++ scripts/docker_build/sof_qemu/Dockerfile | 2 ++ 2 files changed, 4 insertions(+) diff --git a/scripts/docker_build/sof_builder/Dockerfile b/scripts/docker_build/sof_builder/Dockerfile index be19637a1c03..4c37c3750b4f 100644 --- a/scripts/docker_build/sof_builder/Dockerfile +++ b/scripts/docker_build/sof_builder/Dockerfile @@ -26,6 +26,8 @@ ENV https_proxy $host_https_proxy RUN apt-get -y update && \ apt-get install -y \ + vim \ + jed \ autoconf \ bison \ build-essential \ diff --git a/scripts/docker_build/sof_qemu/Dockerfile b/scripts/docker_build/sof_qemu/Dockerfile index 112597feb358..8c7e168a5cc1 100644 --- a/scripts/docker_build/sof_qemu/Dockerfile +++ b/scripts/docker_build/sof_qemu/Dockerfile @@ -24,6 +24,8 @@ ENV https_proxy $host_https_proxy RUN apt-get -y update && \ apt-get install -y \ + vim \ + jed \ autoconf \ build-essential \ git \ From 2aaed67e5b2e46085e2216133e3e105e0348eb8d Mon Sep 17 00:00:00 2001 From: Fred Oh Date: Tue, 11 May 2021 11:14:31 -0700 Subject: [PATCH 4/5] Dockerfile: remove apt.conf dependency There was a assumption /etc/apt/apt.conf has apt proxy settings for the system. This workaround is not required. Signed-off-by: Fred Oh --- scripts/docker_build/sof_builder/Dockerfile | 2 -- scripts/docker_build/sof_builder/docker-build.sh | 8 ++------ scripts/docker_build/sof_qemu/Dockerfile | 2 -- scripts/docker_build/sof_qemu/docker-build.sh | 8 ++------ 4 files changed, 4 insertions(+), 16 deletions(-) diff --git a/scripts/docker_build/sof_builder/Dockerfile b/scripts/docker_build/sof_builder/Dockerfile index 4c37c3750b4f..c5eb66772dce 100644 --- a/scripts/docker_build/sof_builder/Dockerfile +++ b/scripts/docker_build/sof_builder/Dockerfile @@ -17,8 +17,6 @@ FROM ubuntu:18.04 ARG UID=1000 -# Set up proxy from host -COPY apt.conf /etc/apt/ ARG host_http_proxy ARG host_https_proxy ENV http_proxy $host_http_proxy diff --git a/scripts/docker_build/sof_builder/docker-build.sh b/scripts/docker_build/sof_builder/docker-build.sh index b676f0c13643..f3eb15388d2c 100755 --- a/scripts/docker_build/sof_builder/docker-build.sh +++ b/scripts/docker_build/sof_builder/docker-build.sh @@ -2,9 +2,5 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2018 Intel Corporation. All rights reserved. -if [ -f "/etc/apt/apt.conf" ]; then - cp /etc/apt/apt.conf ./ -else - touch apt.conf -fi -docker build --build-arg UID=$(id -u) --build-arg host_http_proxy=$http_proxy --build-arg host_https_proxy=$https_proxy -t sof . +docker build --build-arg UID=$(id -u) --build-arg host_http_proxy="$http_proxy" \ + --build-arg host_https_proxy="$https_proxy" -t sof . diff --git a/scripts/docker_build/sof_qemu/Dockerfile b/scripts/docker_build/sof_qemu/Dockerfile index 8c7e168a5cc1..6387cf532f93 100644 --- a/scripts/docker_build/sof_qemu/Dockerfile +++ b/scripts/docker_build/sof_qemu/Dockerfile @@ -15,8 +15,6 @@ FROM ubuntu:18.04 ARG UID=1000 -# Set up proxy from host -COPY apt.conf /etc/apt/ ARG host_http_proxy ARG host_https_proxy ENV http_proxy $host_http_proxy diff --git a/scripts/docker_build/sof_qemu/docker-build.sh b/scripts/docker_build/sof_qemu/docker-build.sh index 5beba7985625..66a520e06a65 100755 --- a/scripts/docker_build/sof_qemu/docker-build.sh +++ b/scripts/docker_build/sof_qemu/docker-build.sh @@ -2,9 +2,5 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2018 Intel Corporation. All rights reserved. -if [ -f "/etc/apt/apt.conf" ]; then - cp /etc/apt/apt.conf ./ -else - touch apt.conf -fi -docker build --build-arg UID=$(id -u) --build-arg host_http_proxy=$http_proxy --build-arg host_https_proxy=$https_proxy -t sofqemu . +docker build --build-arg UID=$(id -u) --build-arg host_http_proxy="$http_proxy" \ + --build-arg host_https_proxy="$https_proxy" -t sofqemu . From 03bfb88fdbde6f28a75190fd66b60313b750cd8c Mon Sep 17 00:00:00 2001 From: Fred Oh Date: Tue, 11 May 2021 13:01:42 -0700 Subject: [PATCH 5/5] docker: upgrade base ubuntu image to 20.04 Catching up latest LTS Ubuntu image, 20.04. It is supposed to be minor upgrade but alsa-lib need to be set default library path, /usr/lib/x86_64-linux-gnu/. Otherwise topology library loading error is found for SOF tool build. This is typical error message, alsatplg: error while loading shared libraries: libatopology.so.2: cannot open shared object file: No such file or directory. Signed-off-by: Fred Oh --- scripts/docker_build/sof_builder/Dockerfile | 13 +++++++++++-- scripts/docker_build/sof_qemu/Dockerfile | 7 ++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/scripts/docker_build/sof_builder/Dockerfile b/scripts/docker_build/sof_builder/Dockerfile index c5eb66772dce..a152e096aae5 100644 --- a/scripts/docker_build/sof_builder/Dockerfile +++ b/scripts/docker_build/sof_builder/Dockerfile @@ -14,7 +14,7 @@ # docker run -it -v :/home/sof/work/sof.git --user `id -u` sof ./incremental.sh # -FROM ubuntu:18.04 +FROM ubuntu:20.04 ARG UID=1000 ARG host_http_proxy @@ -22,8 +22,13 @@ ARG host_https_proxy ENV http_proxy $host_http_proxy ENV https_proxy $host_https_proxy +# for non-interactive package install +ARG DEBIAN_FRONTEND=noninteractive + RUN apt-get -y update && \ apt-get install -y \ + dialog \ + apt-utils \ vim \ jed \ autoconf \ @@ -60,10 +65,14 @@ echo "sof:test0000" | chpasswd && adduser sof sudo ENV HOME /home/sof # Use ToT alsa utils for the latest topology patches. +# Note: For alsa-lib, set default library directory to /usr/lib/x86_64-linux-gnu. +# By default it goes to /usr/lib64, but Ubuntu 20.04's default shared library +# path does not have this. Typical build error is like, +# alsatplg: error while loading shared libraries: libatopology.so.2: cannot open shared object file: No such file or directory RUN mkdir -p /home/sof/work/alsa && cd /home/sof/work/alsa && \ git clone $CLONE_DEFAULTS https://github.com/thesofproject/alsa-lib.git && \ git clone $CLONE_DEFAULTS https://github.com/thesofproject/alsa-utils.git && \ -cd /home/sof/work/alsa/alsa-lib && ./gitcompile && make install && \ +cd /home/sof/work/alsa/alsa-lib && ./gitcompile --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu/ && make install && \ cd /home/sof/work/alsa/alsa-utils && ./gitcompile && make install &&\ chown -R sof:sof /home/sof diff --git a/scripts/docker_build/sof_qemu/Dockerfile b/scripts/docker_build/sof_qemu/Dockerfile index 6387cf532f93..6864cbd4a76e 100644 --- a/scripts/docker_build/sof_qemu/Dockerfile +++ b/scripts/docker_build/sof_qemu/Dockerfile @@ -12,7 +12,7 @@ # ./scripts/docker-qemu.sh scrpits-or-command-you-want-run # -FROM ubuntu:18.04 +FROM ubuntu:20.04 ARG UID=1000 ARG host_http_proxy @@ -20,10 +20,15 @@ ARG host_https_proxy ENV http_proxy $host_http_proxy ENV https_proxy $host_https_proxy +# for non-interactive package install +ARG DEBIAN_FRONTEND=noninteractive + RUN apt-get -y update && \ apt-get install -y \ vim \ jed \ + dialog \ + apt-utils \ autoconf \ build-essential \ git \