Add proxy support for cli 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
@@ -18,6 +18,14 @@ FROM ubuntu:xenial
ENV GOPATH=/project/sawtooth-seth/cli
ENV PATH=$PATH:/project/sawtooth-seth/cli/bin:/project/sawtooth-seth/bin:/usr/lib/go-1.9/bin
+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 \
@@ -44,6 +52,18 @@ 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 \
+ npm config set proxy $http_proxy; \
+ git config --global http.proxy $http_proxy; \
+ fi; \
+ if [ ! -z $https_proxy ]; then \
+ npm config set https-proxy $https_proxy; \
+ 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 \
