Add proxy support for processor dockerfile
Added proxy script to automatically set valid proxy entries
Added explicit npm proxy setting
Added explicit git proxy setting
Added git conversion to https instead of git, as many http proxies
may not allow git protocol
@@ -19,6 +19,14 @@ ENV GOPATH=/project/sawtooth-seth/processor
ENV PATH=$PATH:/project/sawtooth-seth/processor/bin:/project/sawtooth-seth/bin:/usr/lib/go-1.9/bin
WORKDIR $GOPATH/src/seth_tp
+RUN \
+ if [ ! -z $HTTP_PROXY ] && [ -z $http_proxy ]; then \
+ http_proxy=$HTTP_PROXY; \
+ fi; \
+ if [ ! -z $HTTPS_PROXY ] && [ -z $https_proxy ]; then \
+ https_proxy=$HTTPS_PROXY; \
+ fi
+
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 8AA7AF1F1091A5FD \
&& echo 'deb http://repo.sawtooth.me/ubuntu/1.0/stable xenial universe' >> /etc/apt/sources.list \
&& apt-get update \
@@ -33,6 +41,16 @@ RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 8AA7AF1F10
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
+RUN \
+ if [ ! -z $http_proxy ]; then \
+ git config --global http.proxy $http_proxy; \
+ fi; \
+ if [ ! -z $https_proxy ]; then \
+ git config --global https.proxy $https_proxy; \
+ fi
+
+RUN git config --global url."https://".insteadOf git://
+
RUN go get -u \
github.com/btcsuite/btcd/btcec \
github.com/golang/mock/gomock \
