[Sound-open-firmware] [PATCH 2/2] scripts: docker: Add proxy settings
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.
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 .
On Wed, 2018-05-16 at 11:49 +0800, Xiuli Pan wrote:
# 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-li b.git +RUN cd /root/alsa-build && git clone http://git.alsa-project.org/http/alsa-ut ils.git RUN cd /root/alsa-build/alsa-lib && ./gitcompile && make install RUN cd /root/alsa-build/alsa-utils && ./gitcompile && make install
Can we have this as a cmd line option as http repos sometimes lag behind the git repo. Default will be git:// repos.
Liam
On 5/17/2018 22:30, Liam Girdwood wrote:
On Wed, 2018-05-16 at 11:49 +0800, Xiuli Pan wrote:
# 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-li b.git +RUN cd /root/alsa-build && git clone http://git.alsa-project.org/http/alsa-ut ils.git RUN cd /root/alsa-build/alsa-lib && ./gitcompile && make install RUN cd /root/alsa-build/alsa-utils && ./gitcompile && make install
Can we have this as a cmd line option as http repos sometimes lag behind the git repo. Default will be git:// repos.
Hi Liam,
Sorry I did not receive this email at first and pinged. The git repos will need some more proxy issues. As for to build the docker, I think the minor lag for the alsa-lib is acceptable. We won't change much about it and actually the ct-ng build is extremely slow in docker. I have had a docker image and I think most people may be happy to pull a docker instead of build a docker themselves. The final built docker is about 10G with cache. It is even slower than to build an environment on the host directly.
I pushed mine sof docker image to docker hub, do you think we could have a public release for this? Pull an image is faster than build one. And we don't need to track the alsa-lib very close.
Thanks Xiuli
Liam
On Fri, 2018-05-18 at 11:13 +0800, Pan, Xiuli wrote:
On 5/17/2018 22:30, Liam Girdwood wrote:
On Wed, 2018-05-16 at 11:49 +0800, Xiuli Pan wrote:
# 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/als a-li b.git +RUN cd /root/alsa-build && git clone http://git.alsa-project.org/http/als a-ut ils.git RUN cd /root/alsa-build/alsa-lib && ./gitcompile && make install RUN cd /root/alsa-build/alsa-utils && ./gitcompile && make install
Can we have this as a cmd line option as http repos sometimes lag behind the git repo. Default will be git:// repos.
Hi Liam,
Sorry I did not receive this email at first and pinged. The git repos will need some more proxy issues.
No I mean, we pass in a extra cmd line argument to alter the behaviour of the script i.e to use http or git repos URLs
As for to build the docker, I think the minor lag for the alsa-lib is acceptable.
This has been days out of date in the past.
We won't change much about it and actually the ct-ng build is extremely slow in docker. I have had a docker image and I think most people may be happy to pull a docker instead of build a docker themselves. The final built docker is about 10G with cache. It is even slower than to build an environment on the host directly.
Maybe the docker script can delete the cross tool build directories after it has completed all the gcc builds ? This would save a lot of space.
I pushed mine sof docker image to docker hub, do you think we could have a public release for this?
Yes.
Pull an image is faster than build one. And we don't need to track the alsa-lib very close.
But how would users know to update it when there were ALSA or gcc updates ?
Liam
Thanks Xiuli
Liam
Sound-open-firmware mailing list Sound-open-firmware@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/sound-open-firmware
On 5/18/2018 16:42, Liam Girdwood wrote:
On Fri, 2018-05-18 at 11:13 +0800, Pan, Xiuli wrote:
On 5/17/2018 22:30, Liam Girdwood wrote:
On Wed, 2018-05-16 at 11:49 +0800, Xiuli Pan wrote:
# 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/als a-li b.git +RUN cd /root/alsa-build && git clone http://git.alsa-project.org/http/als a-ut ils.git RUN cd /root/alsa-build/alsa-lib && ./gitcompile && make install RUN cd /root/alsa-build/alsa-utils && ./gitcompile && make install
Can we have this as a cmd line option as http repos sometimes lag behind the git repo. Default will be git:// repos.
Hi Liam,
Sorry I did not receive this email at first and pinged. The git repos will need some more proxy issues.
No I mean, we pass in a extra cmd line argument to alter the behaviour of the script i.e to use http or git repos URLs
OK, Then I will change it like if we did not use proxy, then use git url. Othrewise use http proxy.
As for to build the docker, I think the minor lag for the alsa-lib is acceptable.
This has been days out of date in the past.
We won't change much about it and actually the ct-ng build is extremely slow in docker. I have had a docker image and I think most people may be happy to pull a docker instead of build a docker themselves. The final built docker is about 10G with cache. It is even slower than to build an environment on the host directly.
Maybe the docker script can delete the cross tool build directories after it has completed all the gcc builds ? This would save a lot of space.
That should be a quick way. And I found that we need some built tools for the autogen and configure for the SOF. It is a lot of space. But the build cache is the big deal. I think if we can get a docker image online. People will prefer to use the image since it will also save a lot of time.
I pushed mine sof docker image to docker hub, do you think we could have a public release for this?
Yes.
Cool, We may have a sync with Jocelyn about this.
Pull an image is faster than build one. And we don't need to track the alsa-lib very close.
But how would users know to update it when there were ALSA or gcc updates ?
We may need some docker version scripts for the docker. All docker will have a ENV when build. If we have some major change that need some update with cross compiler or ALSA lib. We can modify the version in the docker as well as the configure check. If the docker ENV version is less than the SOF required version. We may have a message like:"The docker ENV is out of date. Please rebuilt the docker or pull the latest docker form docker hub"
Thanks Xiuli
Liam
Thanks Xiuli
Liam
Sound-open-firmware mailing list Sound-open-firmware@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/sound-open-firmware
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 .
participants (3)
-
Liam Girdwood
-
Pan, Xiuli
-
Xiuli Pan