Commit 6b84c5e6 authored by crlishka's avatar crlishka Committed by Robert Kimball

Fix proxy settings in contrib/docker so that builds work both on the Internet…

Fix proxy settings in contrib/docker so that builds work both on the Internet and within Intel (#1088)

* Added conditional code to only set proxies when hostname appears to be on an Intel network (.intel.com)

* Replaced Intel-network-conditional proxy setting code with a system that checks for existence of http_proxy and https_proxy, like the Makefile does

* Applied fix for NGRAPH-1862, as I ran into NVidia dockerfile hangs.  Temporarily use --no-cache with docker-build, to check that proxy fix really works (and we don't get a cached version).

* Restored an original line I accidentally deleted.

* Remove --no-cache, which I had added for thorough testing.
parent 0deea239
...@@ -4,11 +4,11 @@ FROM nvidia/cuda:8.0-cudnn7-devel-ubuntu16.04 ...@@ -4,11 +4,11 @@ FROM nvidia/cuda:8.0-cudnn7-devel-ubuntu16.04
# try to get around issue with badsig # try to get around issue with badsig
#https://github.com/NVIDIA/nvidia-docker/issues/619 (with devel image) (based on this issue added this) #https://github.com/NVIDIA/nvidia-docker/issues/619 (with devel image) (based on this issue added this)
RUN mv /etc/apt/sources.list.d/cuda.list /tmp/cuda.list RUN rm /etc/apt/sources.list.d/cuda.list
# removing nvidia-ml.list file to avoid apt-get update error # removing nvidia-ml.list file to avoid apt-get update error
# "The method driver /usr/lib/apt/methods/https could not be found." # "The method driver /usr/lib/apt/methods/https could not be found."
RUN mv /etc/apt/sources.list.d/nvidia-ml.list /tmp/nvidia-ml.list RUN rm /etc/apt/sources.list.d/nvidia-ml.list
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y sudo curl apt-transport-https && \ apt-get install -y sudo curl apt-transport-https && \
...@@ -16,9 +16,6 @@ RUN apt-get update && \ ...@@ -16,9 +16,6 @@ RUN apt-get update && \
apt-get autoremove -y apt-get autoremove -y
RUN curl http://developer.download.nvidia.com/compute/cuda/repos/GPGKEY | sudo apt-key add - RUN curl http://developer.download.nvidia.com/compute/cuda/repos/GPGKEY | sudo apt-key add -
RUN mv /tmp/cuda.list /etc/apt/sources.list.d/cuda.list
RUN mv /tmp/nvidia-ml.list /etc/apt/sources.list.d/nvidia-ml.list
# install standard python 2 and 3 environment stuff # install standard python 2 and 3 environment stuff
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y python-dev python-pip software-properties-common && \ apt-get install -y python-dev python-pip software-properties-common && \
......
...@@ -49,6 +49,22 @@ DIMAGE_VERSION=`date -Iseconds | sed -e 's/:/-/g'` ...@@ -49,6 +49,22 @@ DIMAGE_VERSION=`date -Iseconds | sed -e 's/:/-/g'`
DIMAGE_ID="${DIMAGE_NAME}:${DIMAGE_VERSION}" DIMAGE_ID="${DIMAGE_NAME}:${DIMAGE_VERSION}"
# If proxy settings are detected in the environment, make sure they are
# included on the docker-build command-line. This mirrors a similar system
# in the Makefile.
if [ ! -z "${http_proxy}" ] ; then
DOCKER_HTTP_PROXY="--build-arg http_proxy=${http_proxy}"
else
DOCKER_HTTP_PROXY=' '
fi
if [ ! -z "${https_proxy}" ] ; then
DOCKER_HTTPS_PROXY="--build-arg https_proxy=${https_proxy}"
else
DOCKER_HTTPS_PROXY=' '
fi
cd ${CONTEXTDIR} cd ${CONTEXTDIR}
echo ' ' echo ' '
...@@ -57,6 +73,7 @@ echo ' ' ...@@ -57,6 +73,7 @@ echo ' '
# build the docker base image # build the docker base image
docker build --rm=true \ docker build --rm=true \
${DOCKER_HTTP_PROXY} ${DOCKER_HTTPS_PROXY} \
-f="${DFILE}" \ -f="${DFILE}" \
-t="${DIMAGE_ID}" \ -t="${DIMAGE_ID}" \
${CONTEXT} ${CONTEXT}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment