Make apt and docker proxies optional 89/30889/1
authorGary Wu <gary.i.wu@huawei.com>
Thu, 8 Feb 2018 15:16:37 +0000 (07:16 -0800)
committerGary Wu <gary.i.wu@huawei.com>
Thu, 8 Feb 2018 15:16:37 +0000 (07:16 -0800)
Change-Id: Id786be755d8db88359c00cb442d7132afbb64f95
Issue-ID: INT-414
Signed-off-by: Gary Wu <gary.i.wu@huawei.com>
deployment/heat/onap-oom/rancher_vm_entrypoint.sh

index da19554..ac704f1 100644 (file)
@@ -3,15 +3,19 @@ printenv
 
 echo `hostname -I` `hostname` >> /etc/hosts
 mkdir -p /etc/docker
-cat > /etc/docker/daemon.json <<EOF
+if [ ! -z "__docker_proxy__" ]; then
+    cat > /etc/docker/daemon.json <<EOF
 {
   "insecure-registries" : ["__docker_proxy__"]
 }
 EOF
-cat > /etc/apt/apt.conf.d/30proxy<<EOF
+fi
+if [ ! -z "__apt_proxy__" ]; then
+    cat > /etc/apt/apt.conf.d/30proxy<<EOF
 Acquire::http { Proxy "http://__apt_proxy__"; };
 Acquire::https::Proxy "DIRECT";
 EOF
+fi
 apt-get -y update
 apt-get -y install docker.io
 usermod -aG docker ubuntu