From 7278f0a6cd427e98d3ad81caf18ea3c5c24ed438 Mon Sep 17 00:00:00 2001
From: beierlm <mark.beierl@canonical.com>
Date: Wed, 26 Jan 2022 10:18:21 -0500
Subject: [PATCH] Bug 1841: LTS Support

Updates base to Ubuntu 20.04
Updates python to 3.8
Updates pip dependencies to more recent versions
Adds apt cache to stage 2 dockerfile
Change stage 3 base image to Ubuntu 20.04 so we can use
python3.8

Fixes bug 1841

Change-Id: I442d0ecf09f033946bbbc3301fd8de54382a4195
Signed-off-by: beierlm <mark.beierl@canonical.com>
---
 Dockerfile                             |  6 ++++
 docker/LCM/Dockerfile                  | 37 +++++++++++++++-------
 docker/MON/Dockerfile                  | 21 ++++++++++---
 docker/NBI/Dockerfile                  | 28 +++++++++++------
 docker/NG-UI/Dockerfile                | 32 +++++++++++--------
 docker/PLA/Dockerfile                  | 43 +++++++++++++++++++-------
 docker/POL/Dockerfile                  | 20 +++++++++---
 docker/RO/Dockerfile                   | 33 +++++++++++++-------
 docker/osmclient/Dockerfile            | 41 +++++++++++++++++-------
 docker/tests/Dockerfile                | 24 +++++++-------
 jenkins/ci-pipelines/ci_stage_2.groovy |  2 +-
 jenkins/ci-pipelines/ci_stage_3.groovy |  2 +-
 12 files changed, 198 insertions(+), 91 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index a3f74004..931da3ec 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -26,6 +26,12 @@
 
 FROM ubuntu:18.04
 
+ARG APT_PROXY
+RUN if [ ! -z $APT_PROXY ] ; then \
+    echo "Acquire::http::Proxy \"$APT_PROXY\";" > /etc/apt/apt.conf.d/proxy.conf ;\
+    echo "Acquire::https::Proxy \"$APT_PROXY\";" >> /etc/apt/apt.conf.d/proxy.conf ;\
+    fi
+
 RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
     DEBIAN_FRONTEND=noninteractive apt-get -y install \
         debhelper \
diff --git a/docker/LCM/Dockerfile b/docker/LCM/Dockerfile
index 7a5e3768..8669369a 100644
--- a/docker/LCM/Dockerfile
+++ b/docker/LCM/Dockerfile
@@ -16,19 +16,21 @@
 
 ########################################################################
 
-FROM ubuntu:18.04 as INSTALL
+FROM ubuntu:20.04 as INSTALL
 
 RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
     DEBIAN_FRONTEND=noninteractive apt-get --yes install \
-    gcc=4:7.4.* \
-    python3=3.6.* \
-    python3-dev=3.6.* \
-    python3-setuptools=39.0.* \
-    curl=7.58.* \
-    apt-transport-https=1.6.* \
+    gcc=4:9.3.* \
+    python3=3.8.* \
+    python3-dev=3.8.* \
+    python3-pip=20.0.2* \
+    python3-setuptools=45.2.* \
+    curl=7.68.*
+
+RUN DEBIAN_FRONTEND=noninteractive apt-get --yes install \
+    apt-transport-https=2.0.* \
     gnupg2=2.2.* \
-    openssh-client=1:7.* && \
-    python3 -m easy_install pip==21.0.1 setuptools==51.0.0
+    openssh-client=1:8.*
 
 RUN curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - \
     && echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | tee -a /etc/apt/sources.list.d/kubernetes.list \
@@ -63,16 +65,27 @@ RUN pip3 install \
     -r /usr/lib/python3/dist-packages/osm_lcm/requirements.txt \
     -r /usr/lib/python3/dist-packages/n2vc/requirements.txt
 
-FROM ubuntu:18.04
+#######################################################################################
+FROM ubuntu:20.04 as FINAL
+
+ARG APT_PROXY
+RUN if [ ! -z $APT_PROXY ] ; then \
+    echo "Acquire::http::Proxy \"$APT_PROXY\";" > /etc/apt/apt.conf.d/proxy.conf ;\
+    echo "Acquire::https::Proxy \"$APT_PROXY\";" >> /etc/apt/apt.conf.d/proxy.conf ;\
+    fi
+
+RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
+    DEBIAN_FRONTEND=noninteractive apt-get --yes install \
+    python3-minimal=3.8.* \
+    && rm -rf /var/lib/apt/lists/*
 
 RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
     DEBIAN_FRONTEND=noninteractive apt-get --yes install \
-    python3-minimal=3.6.* \
     ca-certificates \
     && rm -rf /var/lib/apt/lists/*
 
 COPY --from=INSTALL /usr/lib/python3/dist-packages /usr/lib/python3/dist-packages
-COPY --from=INSTALL /usr/local/lib/python3.6/dist-packages  /usr/local/lib/python3.6/dist-packages
+COPY --from=INSTALL /usr/local/lib/python3.8/dist-packages  /usr/local/lib/python3.8/dist-packages
 
 COPY --from=INSTALL /usr/bin/kubectl /usr/bin/kubectl
 COPY --from=INSTALL /usr/local/bin/helm /usr/local/bin/helm
diff --git a/docker/MON/Dockerfile b/docker/MON/Dockerfile
index 719d633a..0046df8a 100644
--- a/docker/MON/Dockerfile
+++ b/docker/MON/Dockerfile
@@ -24,13 +24,15 @@ FROM ubuntu:20.04 as INSTALL
 
 RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
     DEBIAN_FRONTEND=noninteractive apt-get --yes install \
-    curl=7.68.* \
     gcc=4:9.3.* \
     python3=3.8.* \
-    python3-setuptools=45.2.* \
     python3-dev=3.8.* \
-    openssh-client=1:8.* && \
-    python3 -m easy_install pip==21.0.1 setuptools==51.0.0
+    python3-pip=20.0.2* \
+    python3-setuptools=45.2.* \
+    curl=7.68.*
+
+RUN DEBIAN_FRONTEND=noninteractive apt-get --yes install \
+    openssh-client=1:8.*
 
 ARG PYTHON3_OSM_COMMON_URL
 ARG PYTHON3_OSM_MON_URL
@@ -50,11 +52,22 @@ RUN pip3 install \
     -r /usr/lib/python3/dist-packages/osm_common/requirements.txt \
     -r /usr/lib/python3/dist-packages/osm_mon/requirements.txt
 
+#######################################################################################
 FROM ubuntu:20.04 as FINAL
 
+ARG APT_PROXY
+RUN if [ ! -z $APT_PROXY ] ; then \
+    echo "Acquire::http::Proxy \"$APT_PROXY\";" > /etc/apt/apt.conf.d/proxy.conf ;\
+    echo "Acquire::https::Proxy \"$APT_PROXY\";" >> /etc/apt/apt.conf.d/proxy.conf ;\
+    fi
+
 RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
     DEBIAN_FRONTEND=noninteractive apt-get --yes install \
     python3-minimal=3.8.* \
+    && rm -rf /var/lib/apt/lists/*
+
+RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
+    DEBIAN_FRONTEND=noninteractive apt-get --yes install \
     ca-certificates \
     && rm -rf /var/lib/apt/lists/*
 
diff --git a/docker/NBI/Dockerfile b/docker/NBI/Dockerfile
index 4ac2a495..49399fbe 100644
--- a/docker/NBI/Dockerfile
+++ b/docker/NBI/Dockerfile
@@ -16,16 +16,16 @@
 
 ########################################################################
 
-FROM ubuntu:18.04 as INSTALL
+FROM ubuntu:20.04 as INSTALL
 
 RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
     DEBIAN_FRONTEND=noninteractive apt-get --yes install \
-    gcc=4:7.4.* \
-    python3=3.6.* \
-    python3-dev=3.6.* \
-    python3-setuptools=39.0.* \
-    curl=7.58.* && \
-    python3 -m easy_install pip==21.0.1 setuptools==51.0.0
+    gcc=4:9.3.* \
+    python3=3.8.* \
+    python3-dev=3.8.* \
+    python3-pip=20.0.2* \
+    python3-setuptools=45.2.* \
+    curl=7.68.*
 
 ARG PYTHON3_OSM_COMMON_URL
 ARG PYTHON3_OSM_IM_URL
@@ -45,14 +45,22 @@ RUN pip3 install \
     -r /usr/lib/python3/dist-packages/osm_im/requirements.txt \
     -r /usr/lib/python3/dist-packages/osm_nbi/requirements.txt
 
-FROM ubuntu:18.04 as FINAL
+#######################################################################################
+FROM ubuntu:20.04 as FINAL
+
+ARG APT_PROXY
+RUN if [ ! -z $APT_PROXY ] ; then \
+    echo "Acquire::http::Proxy \"$APT_PROXY\";" > /etc/apt/apt.conf.d/proxy.conf ;\
+    echo "Acquire::https::Proxy \"$APT_PROXY\";" >> /etc/apt/apt.conf.d/proxy.conf ;\
+    fi
 
 RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
-    DEBIAN_FRONTEND=noninteractive apt-get --yes install python3-minimal=3.6.* \
+    DEBIAN_FRONTEND=noninteractive apt-get --yes install \
+    python3-minimal=3.8.* \
     && rm -rf /var/lib/apt/lists/*
 
 COPY --from=INSTALL /usr/lib/python3/dist-packages /usr/lib/python3/dist-packages
-COPY --from=INSTALL /usr/local/lib/python3.6/dist-packages  /usr/local/lib/python3.6/dist-packages
+COPY --from=INSTALL /usr/local/lib/python3.8/dist-packages  /usr/local/lib/python3.8/dist-packages
 
 RUN mkdir -p /app/storage/kafka && mkdir -p /app/log
 
diff --git a/docker/NG-UI/Dockerfile b/docker/NG-UI/Dockerfile
index 53ec2a9d..29b1ae48 100644
--- a/docker/NG-UI/Dockerfile
+++ b/docker/NG-UI/Dockerfile
@@ -13,22 +13,21 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-FROM ubuntu:18.04 AS BUILD
+FROM ubuntu:20.04 as INSTALL
 
 RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
     DEBIAN_FRONTEND=noninteractive apt-get --yes install \
-    apt-transport-https=1.6.* \
-    curl=7.58.* \
+    apt-transport-https=2.0.* \
+    curl=7.68.* \
     gnupg2=2.2.* \
-    nginx=1.14.* \
-    software-properties-common=0.96.* \
+    nginx=1.18.* \
+    software-properties-common=0.99.* \
     xz-utils=5.2.*
 
 RUN curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \
-    echo "deb https://deb.nodesource.com/node_10.x xenial main" | tee -a /etc/apt/sources.list.d/nodesource.list && \
-    apt-get update && \
-    apt-get install -y nodejs=10.24.* \
-    && rm -rf /var/lib/apt/lists/*
+    echo "deb https://deb.nodesource.com/node_10.x focal main" | tee -a /etc/apt/sources.list.d/nodesource.list && \
+    DEBIAN_FRONTEND=noninteractive apt-get update && \
+    DEBIAN_FRONTEND=noninteractive apt-get install -y nodejs=10.24.*
 
 ARG OSM_NGUI_URL
 
@@ -41,21 +40,28 @@ RUN npm install
 # Building app.
 RUN npm run build
 
-FROM ubuntu:18.04 AS FINAL
+#######################################################################################
+FROM ubuntu:20.04 AS FINAL
+
+ARG APT_PROXY
+RUN if [ ! -z $APT_PROXY ] ; then \
+    echo "Acquire::http::Proxy \"$APT_PROXY\";" > /etc/apt/apt.conf.d/proxy.conf ;\
+    echo "Acquire::https::Proxy \"$APT_PROXY\";" >> /etc/apt/apt.conf.d/proxy.conf ;\
+    fi
 
 RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
     DEBIAN_FRONTEND=noninteractive apt-get --yes install \
-    nginx=1.14.* && \
+    nginx=1.18.* && \
     rm -rf /var/lib/apt/lists/*
 
 # Removing the Nginx default page.
 RUN rm -rf /usr/share/nginx/html/*
 
 # Copying Nginx configuration
-COPY --from=BUILD /usr/share/osm-ngui/nginx/nginx.conf /etc/nginx/sites-available/default
+COPY --from=INSTALL /usr/share/osm-ngui/nginx/nginx.conf /etc/nginx/sites-available/default
 
 # Copying angular build to Nginx default page.
-COPY --from=BUILD /usr/share/osm-ngui/dist/osm /usr/share/nginx/html
+COPY --from=INSTALL /usr/share/osm-ngui/dist/osm /usr/share/nginx/html
 
 EXPOSE 80
 
diff --git a/docker/PLA/Dockerfile b/docker/PLA/Dockerfile
index 8d4350bc..36865e5c 100644
--- a/docker/PLA/Dockerfile
+++ b/docker/PLA/Dockerfile
@@ -13,16 +13,28 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-FROM ubuntu:18.04 as INSTALL
+FROM ubuntu:20.04 as INSTALL
+
+ARG APT_PROXY
+RUN if [ ! -z $APT_PROXY ] ; then \
+    echo "Acquire::http::Proxy \"$APT_PROXY\";" > /etc/apt/apt.conf.d/proxy.conf ;\
+    echo "Acquire::https::Proxy \"$APT_PROXY\";" >> /etc/apt/apt.conf.d/proxy.conf ;\
+    fi
+
+ARG APT_PROXY
+RUN if [ ! -z $APT_PROXY ] ; then \
+    echo "Acquire::http::Proxy \"$APT_PROXY\";" > /etc/apt/apt.conf.d/proxy.conf ;\
+    echo "Acquire::https::Proxy \"$APT_PROXY\";" >> /etc/apt/apt.conf.d/proxy.conf ;\
+    fi
 
 RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
     DEBIAN_FRONTEND=noninteractive apt-get --yes install \
-    gcc=4:7.4.* \
-    python3=3.6.* \
-    python3-dev=3.6.* \
-    python3-setuptools=39.0.* \
-    curl=7.58.* && \
-    python3 -m easy_install pip==21.0.1 setuptools==51.0.0
+    gcc=4:9.3.* \
+    python3=3.8.* \
+    python3-dev=3.8.* \
+    python3-pip=20.0.2* \
+    python3-setuptools=45.2.* \
+    curl=7.68.*
 
 ARG PYTHON3_OSM_COMMON_URL
 ARG PYTHON3_OSM_PLA_URL
@@ -42,15 +54,24 @@ ADD https://github.com/MiniZinc/MiniZincIDE/releases/download/2.4.2/MiniZincIDE-
 RUN tar -zxf /minizinc.tgz && \
     mv /MiniZincIDE-2.4.2-bundle-linux /minizinc
 
-FROM ubuntu:18.04
-LABEL authors="Lars-Göran Magnusson"
+#######################################################################################
+FROM ubuntu:20.04 as FINAL
+
+ARG APT_PROXY
+RUN if [ ! -z $APT_PROXY ] ; then \
+    echo "Acquire::http::Proxy \"$APT_PROXY\";" > /etc/apt/apt.conf.d/proxy.conf ;\
+    echo "Acquire::https::Proxy \"$APT_PROXY\";" >> /etc/apt/apt.conf.d/proxy.conf ;\
+    fi
 
 RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
-    DEBIAN_FRONTEND=noninteractive apt-get --yes install python3-minimal=3.6.* \
+    DEBIAN_FRONTEND=noninteractive apt-get --yes install \
+    python3-minimal=3.8.* \
     && rm -rf /var/lib/apt/lists/*
 
+LABEL authors="Lars-Göran Magnusson"
+
 COPY --from=INSTALL /usr/lib/python3/dist-packages /usr/lib/python3/dist-packages
-COPY --from=INSTALL /usr/local/lib/python3.6/dist-packages  /usr/local/lib/python3.6/dist-packages
+COPY --from=INSTALL /usr/local/lib/python3.8/dist-packages /usr/local/lib/python3.8/dist-packages
 COPY --from=INSTALL /usr/bin/osm* /usr/bin/
 COPY --from=INSTALL /minizinc /minizinc
 
diff --git a/docker/POL/Dockerfile b/docker/POL/Dockerfile
index 3e708b73..a88ecaef 100644
--- a/docker/POL/Dockerfile
+++ b/docker/POL/Dockerfile
@@ -24,13 +24,15 @@ FROM ubuntu:20.04 as INSTALL
 
 RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
     DEBIAN_FRONTEND=noninteractive apt-get --yes install \
-    curl=7.68.* \
     gcc=4:9.3.* \
     python3=3.8.* \
-    python3-setuptools=45.2.* \
     python3-dev=3.8.* \
-    mysql-client-core-8.0=8.0.* && \
-    python3 -m easy_install pip==21.0.1 setuptools==51.0.0
+    python3-pip=20.0.2* \
+    python3-setuptools=45.2.* \
+    curl=7.68.*
+
+RUN DEBIAN_FRONTEND=noninteractive apt-get --yes install \
+    mysql-client-core-8.0=8.0.*
 
 ARG PYTHON3_OSM_COMMON_URL
 ARG PYTHON3_OSM_POLICY_MODULE_URL
@@ -45,10 +47,18 @@ RUN pip3 install \
     -r /usr/lib/python3/dist-packages/osm_common/requirements.txt \
     -r /usr/lib/python3/dist-packages/osm_policy_module/requirements.txt
 
+#######################################################################################
 FROM ubuntu:20.04 as FINAL
 
+ARG APT_PROXY
+RUN if [ ! -z $APT_PROXY ] ; then \
+    echo "Acquire::http::Proxy \"$APT_PROXY\";" > /etc/apt/apt.conf.d/proxy.conf ;\
+    echo "Acquire::https::Proxy \"$APT_PROXY\";" >> /etc/apt/apt.conf.d/proxy.conf ;\
+    fi
+
 RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
-    DEBIAN_FRONTEND=noninteractive apt-get --yes install python3-minimal=3.8.* \
+    DEBIAN_FRONTEND=noninteractive apt-get --yes install \
+    python3-minimal=3.8.* \
     && rm -rf /var/lib/apt/lists/*
 
 COPY --from=INSTALL /usr/lib/python3/dist-packages /usr/lib/python3/dist-packages
diff --git a/docker/RO/Dockerfile b/docker/RO/Dockerfile
index 070ec368..8402b426 100644
--- a/docker/RO/Dockerfile
+++ b/docker/RO/Dockerfile
@@ -16,18 +16,21 @@
 
 ########################################################################
 
-FROM ubuntu:18.04 as INSTALL
+FROM ubuntu:20.04 as INSTALL
+
+RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
+    DEBIAN_FRONTEND=noninteractive apt-get --yes install \
+    gcc=4:9.3.* \
+    python3=3.8.* \
+    python3-dev=3.8.* \
+    python3-pip=20.0.2* \
+    python3-setuptools=45.2.* \
+    curl=7.68.*
 
 RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
     DEBIAN_FRONTEND=noninteractive apt-get --yes install \
-    gcc=4:7.4.* \
-    python3=3.6.* \
-    python3-dev=3.6.* \
-    python3-setuptools=39.0.* \
-    curl=7.58.* \
     genisoimage=9:1.1.* \
-    netbase=5.* && \
-    python3 -m easy_install pip==21.0.1 setuptools==51.0.0
+    netbase=6.*
 
 ARG PYTHON3_OSM_COMMON_URL
 ARG PYTHON3_OSM_NG_RO_URL
@@ -76,14 +79,22 @@ RUN pip3 install \
     -r /usr/lib/python3/dist-packages/osm_common/requirements.txt \
     -r /usr/lib/python3/dist-packages/osm_ng_ro/requirements.txt
 
-FROM ubuntu:18.04
+#######################################################################################
+FROM ubuntu:20.04 as FINAL
+
+ARG APT_PROXY
+RUN if [ ! -z $APT_PROXY ] ; then \
+    echo "Acquire::http::Proxy \"$APT_PROXY\";" > /etc/apt/apt.conf.d/proxy.conf ;\
+    echo "Acquire::https::Proxy \"$APT_PROXY\";" >> /etc/apt/apt.conf.d/proxy.conf ;\
+    fi
 
 RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
-    DEBIAN_FRONTEND=noninteractive apt-get --yes install python3-minimal=3.6.* \
+    DEBIAN_FRONTEND=noninteractive apt-get --yes install \
+    python3-minimal=3.8.* \
     && rm -rf /var/lib/apt/lists/*
 
 COPY --from=INSTALL /usr/lib/python3/dist-packages /usr/lib/python3/dist-packages
-COPY --from=INSTALL /usr/local/lib/python3.6/dist-packages  /usr/local/lib/python3.6/dist-packages
+COPY --from=INSTALL /usr/local/lib/python3.8/dist-packages  /usr/local/lib/python3.8/dist-packages
 COPY --from=INSTALL /usr/bin/genisoimage /usr/bin/genisoimage
 COPY --from=INSTALL /etc/protocols /etc/protocols
 
diff --git a/docker/osmclient/Dockerfile b/docker/osmclient/Dockerfile
index 299990ad..e5e1f300 100644
--- a/docker/osmclient/Dockerfile
+++ b/docker/osmclient/Dockerfile
@@ -15,18 +15,26 @@
 # limitations under the License.
 #######################################################################################
 
-FROM ubuntu:18.04 as INSTALL
+FROM ubuntu:20.04 as INSTALL
+
+ARG APT_PROXY
+RUN if [ ! -z $APT_PROXY ] ; then \
+    echo "Acquire::http::Proxy \"$APT_PROXY\";" > /etc/apt/apt.conf.d/proxy.conf ;\
+    echo "Acquire::https::Proxy \"$APT_PROXY\";" >> /etc/apt/apt.conf.d/proxy.conf ;\
+    fi
 
 RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
     DEBIAN_FRONTEND=noninteractive apt-get --yes install \
-    gcc=4:7.4.* \
-    python3=3.6.* \
-    python3-dev=3.6.* \
-    python3-setuptools=39.0.* \
-    curl=7.58.* \
-    libcurl4-openssl-dev=7.58.* \
-    libssl-dev=1.1.* && \
-    python3 -m easy_install pip==21.0.1 setuptools==51.0.0
+    gcc=4:9.3.* \
+    python3=3.8.* \
+    python3-dev=3.8.* \
+    python3-pip=20.0.2* \
+    python3-setuptools=45.2.* \
+    curl=7.68.*
+
+RUN DEBIAN_FRONTEND=noninteractive apt-get --yes install \
+    libcurl4-openssl-dev=7.68.* \
+    libssl-dev=1.1.* 
 
 ARG PYTHON3_OSMCLIENT_URL
 ARG PYTHON3_OSM_IM_URL
@@ -41,13 +49,22 @@ RUN pip3 install \
     -r /usr/lib/python3/dist-packages/osmclient/requirements.txt \
     -r /usr/lib/python3/dist-packages/osm_im/requirements.txt
 
-FROM ubuntu:18.04 as FINAL
+#######################################################################################
+FROM ubuntu:20.04 as FINAL
+
+ARG APT_PROXY
+RUN if [ ! -z $APT_PROXY ] ; then \
+    echo "Acquire::http::Proxy \"$APT_PROXY\";" > /etc/apt/apt.conf.d/proxy.conf ;\
+    echo "Acquire::https::Proxy \"$APT_PROXY\";" >> /etc/apt/apt.conf.d/proxy.conf ;\
+    fi
 
 RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
-    DEBIAN_FRONTEND=noninteractive apt-get --yes install python3-minimal=3.6.*
+    DEBIAN_FRONTEND=noninteractive apt-get --yes install \
+    python3-minimal=3.8.* \
+    && rm -rf /var/lib/apt/lists/*
 
 COPY --from=INSTALL /usr/lib/python3/dist-packages /usr/lib/python3/dist-packages
-COPY --from=INSTALL /usr/local/lib/python3.6/dist-packages  /usr/local/lib/python3.6/dist-packages
+COPY --from=INSTALL /usr/local/lib/python3.8/dist-packages  /usr/local/lib/python3.8/dist-packages
 
 ENV OSM_SOL005=True
 ENV OSM_HOSTNAME=nbi:9999
diff --git a/docker/tests/Dockerfile b/docker/tests/Dockerfile
index 4874ef1e..d7dfcdb0 100644
--- a/docker/tests/Dockerfile
+++ b/docker/tests/Dockerfile
@@ -15,22 +15,24 @@
 
 ########################################################################
 
-FROM ubuntu:18.04 as INSTALL
+FROM ubuntu:20.04 as FINAL
 
 RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
     DEBIAN_FRONTEND=noninteractive apt-get --yes install \
-    gcc=4:7.4.* \
-    python3=3.6.* \
-    python3-dev=3.6.* \
-    python3-setuptools=39.0.* \
-    curl=7.58.* \
+    gcc=4:9.3.* \
+    python3=3.8.* \
+    python3-dev=3.8.* \
+    python3-pip=20.0.2* \
+    python3-setuptools=45.2.* \
+    curl=7.68.*
+
+RUN DEBIAN_FRONTEND=noninteractive apt-get --yes install \
     gettext-base=0.19.* \
-    git=1:2.17.* \
+    git=1:2.25.* \
     iputils-ping=3:* \
-    jq=1.5* \
-    libcurl4-openssl-dev=7.58.* \
-    libssl-dev=1.1.* && \
-    python3 -m easy_install pip==21.0.1 setuptools==51.0.0
+    jq=1.6* \
+    libcurl4-openssl-dev=7.68.* \
+    libssl-dev=1.1.*
 
 ARG OSM_TESTS_URL
 ARG PYTHON3_OSM_IM_URL
diff --git a/jenkins/ci-pipelines/ci_stage_2.groovy b/jenkins/ci-pipelines/ci_stage_2.groovy
index dd9cc9b1..72318f9a 100644
--- a/jenkins/ci-pipelines/ci_stage_2.groovy
+++ b/jenkins/ci-pipelines/ci_stage_2.groovy
@@ -116,7 +116,7 @@ def ci_pipeline(mdg,url_prefix,project,branch,refspec,revision,do_stage_3,artifa
             def downstream_params_stage_3 = [
                 string(name: 'GERRIT_BRANCH', value: "${branch}"),
                 string(name: 'INSTALLER', value: "Default" ),
-                string(name: 'OPENSTACK_BASE_IMAGE', value: "ubuntu18.04" ),
+                string(name: 'OPENSTACK_BASE_IMAGE', value: "ubuntu20.04" ),
                 string(name: 'UPSTREAM_JOB_NAME', value: "${JOB_NAME}" ),
                 string(name: 'UPSTREAM_JOB_NUMBER', value: "${BUILD_NUMBER}" ),
                 booleanParam(name: 'DO_STAGE_4', value: do_stage_4 )
diff --git a/jenkins/ci-pipelines/ci_stage_3.groovy b/jenkins/ci-pipelines/ci_stage_3.groovy
index cd7cc8ed..6a82bfc5 100644
--- a/jenkins/ci-pipelines/ci_stage_3.groovy
+++ b/jenkins/ci-pipelines/ci_stage_3.groovy
@@ -32,7 +32,7 @@ properties([
         string(defaultValue: 'artifactory-osm', description: '', name: 'ARTIFACTORY_SERVER'),
         string(defaultValue: 'osm-stage_4', description: '', name: 'DOWNSTREAM_STAGE_NAME'),
         string(defaultValue: 'testing-daily', description: '', name: 'DOCKER_TAG'),
-        string(defaultValue: 'ubuntu18.04', description: '', name: 'OPENSTACK_BASE_IMAGE'),
+        string(defaultValue: 'ubuntu20.04', description: '', name: 'OPENSTACK_BASE_IMAGE'),
         booleanParam(defaultValue: false, description: '', name: 'SAVE_CONTAINER_ON_FAIL'),
         booleanParam(defaultValue: false, description: '', name: 'SAVE_CONTAINER_ON_PASS'),
         booleanParam(defaultValue: true, description: '', name: 'SAVE_ARTIFACTS_ON_SMOKE_SUCCESS'),
-- 
GitLab