On 5/16/2018 11:49, Xiuli Pan wrote:
From: Pan Xiuli xiuli.pan@linux.intel.com
Modify Dockerfile to copy apt.conf from host and set host proxy to environment. Also modify some git url to http url in order to use the proxy.
Ping for review.
This is needed for use docker within proxy.
Thanks
Xiuli
Also add a docker-build.sh to help docker build
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com
scripts/README.docker | 3 ++- scripts/docker_build/Dockerfile | 11 +++++++++-- scripts/docker_build/docker-build.sh | 7 +++++++ 3 files changed, 18 insertions(+), 3 deletions(-) create mode 100755 scripts/docker_build/docker-build.sh
diff --git a/scripts/README.docker b/scripts/README.docker index fd390d6..1a8589f 100644 --- a/scripts/README.docker +++ b/scripts/README.docker @@ -10,7 +10,8 @@ First, build the docker container. This step needs to be done initially and when the toolchain or alsa dependencies are updated.
cd scripts/docker_build -docker build --build-arg UID=$(id -u) -t sof .
+./docker-build.sh
After the container is built, it can be used to run the scripts.
diff --git a/scripts/docker_build/Dockerfile b/scripts/docker_build/Dockerfile index 814fbac..0b9ce64 100644 --- a/scripts/docker_build/Dockerfile +++ b/scripts/docker_build/Dockerfile @@ -17,6 +17,13 @@ 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 +ENV https_proxy $host_https_proxy
- RUN apt-get -y update && \ apt-get install -y \ autoconf \
@@ -45,8 +52,8 @@ RUN apt-get -y update && \
# Use ToT alsa utils for the latest topology patches. RUN mkdir -p /root/alsa-build -RUN cd /root/alsa-build && git clone git://git.alsa-project.org/alsa-lib.git -RUN cd /root/alsa-build && git clone git://git.alsa-project.org/alsa-utils.git +RUN cd /root/alsa-build && git clone http://git.alsa-project.org/http/alsa-lib.git +RUN cd /root/alsa-build && git clone http://git.alsa-project.org/http/alsa-utils.git RUN cd /root/alsa-build/alsa-lib && ./gitcompile && make install RUN cd /root/alsa-build/alsa-utils && ./gitcompile && make install
diff --git a/scripts/docker_build/docker-build.sh b/scripts/docker_build/docker-build.sh new file mode 100755 index 0000000..1090f15 --- /dev/null +++ b/scripts/docker_build/docker-build.sh @@ -0,0 +1,7 @@ +#!/bin/bash +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 .