From 1bd90e162ac2694ce791d0c053022935144d74c6 Mon Sep 17 00:00:00 2001
From: Martin Hierholzer <martin.hierholzer@desy.de>
Date: Tue, 8 Feb 2022 17:07:31 +0100
Subject: [PATCH] set proxy through build arguments (#10)

* proxy is set through build arguments.
settings stub for network, git , sudo has been removed.

* removed comments not parsed correctly by docker.

* changed: tumbleweed.docker proxy is set through build argument.

Co-authored-by: Nadeem <nadeem.shehzad@desy.de>
---
 dockerfiles/focal.docker      | 15 ++++-----------
 dockerfiles/tumbleweed.docker |  4 ++--
 2 files changed, 6 insertions(+), 13 deletions(-)

diff --git a/dockerfiles/focal.docker b/dockerfiles/focal.docker
index 7355fb0..3ae9159 100644
--- a/dockerfiles/focal.docker
+++ b/dockerfiles/focal.docker
@@ -1,6 +1,6 @@
 FROM ubuntu:focal
-ENV http_proxy http://xfelproxy.desy.de:3128
-ENV https_proxy http://xfelproxy.desy.de:3128
+ENV http_proxy ${http_proxy}
+ENV https_proxy ${https_proxy}
 ENV DEBIAN_FRONTEND noninteractive
 
 RUN apt-get update && \
@@ -10,7 +10,7 @@ RUN apt-get update && \
     apt-get update && \
     apt-get upgrade -y && \
     apt-get dist-upgrade -y && \
-    apt-get install -y sudo wget python3-pip locales pigz \ 
+    apt-get install -y sudo wget python3-pip locales pigz \
         g++ valgrind cppcheck lcov doxygen procmail make git gdb cmake ninja-build \
         libboost-all-dev libxml++2.6-dev \
         libldap2-dev libzmq3-dev rpcbind \
@@ -42,15 +42,8 @@ RUN apt-get update && \
     ln -sfn /usr/lib/x86_64-linux-gnu/libzmq.so.5 /usr/lib/x86_64-linux-gnu/libzmq.so.3 && \
     pip3 install meson
 
-RUN echo "Defaults set_home" >> /etc/sudoers && \
-    echo 'Acquire::http::proxy "http://xfelproxy.desy.de:3128/";' > /etc/apt/apt.conf && \
-    echo 'http_proxy=http://xfelproxy.desy.de:3128' >> /etc/environment && \
-    echo 'https_proxy=https://xfelproxy.desy.de:3128' >> /etc/environment && \
-    git config --system http.proxy http://xfelproxy.desy.de:3128 && \
-    git config --system https.proxy http://xfelproxy.desy.de:3128
-   
 # NOTE: This last line (symlink for libzmq.so.3) is a hack for a bug in DOOCS serverlib, which has the version number hardcoded.
-   
+
 ADD lcov-to-cobertura-xml /common/lcov_cobertura-1.6
 
 # Start rpcbind at launch of the container, required for DOOCS
diff --git a/dockerfiles/tumbleweed.docker b/dockerfiles/tumbleweed.docker
index fccfde2..145d032 100644
--- a/dockerfiles/tumbleweed.docker
+++ b/dockerfiles/tumbleweed.docker
@@ -1,6 +1,6 @@
 FROM opensuse/tumbleweed:latest
-ENV http_proxy http://xfelproxy.desy.de:3128
-ENV https_proxy http://xfelproxy.desy.de:3128
+ENV http_proxy ${http_proxy}
+ENV https_proxy ${https_proxy}
 
 RUN zypper refresh && \
     zypper up -y && \
-- 
GitLab