Update docker image
Switch to ubuntu:20.04 as a base image
to use python3.8 natively and to support the
latest CVE fixes for python packages
Related-Prod: PROD-36143
Change-Id: I5e1e8fb6d3b4987522a96b621898afd08958fe20
(cherry picked from commit 734246f67621695b367cb5c0bc91d8c6b7e5397a)
diff --git a/Dockerfile b/Dockerfile
index de6bd6f..c6690ba 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,6 +1,7 @@
-FROM ubuntu:16.04
+FROM ubuntu:20.04
LABEL maintainer="dev@mirantis.com"
+LABEL build_date="2021-03-23"
ENV DEBIAN_FRONTEND=noninteractive \
DEBCONF_NONINTERACTIVE_SEEN=true \
@@ -18,21 +19,20 @@
WORKDIR /var/lib/
COPY bin/ /usr/local/bin/
COPY test_set/ ./
-#
+
RUN set -exo pipefail; pushd /etc/apt/ && echo > sources.list && \
echo 'Acquire::Languages "none";' > apt.conf.d/docker-no-languages && \
echo 'Acquire::GzipIndexes "true"; Acquire::CompressionTypes::Order:: "gz";' > apt.conf.d/docker-gzip-indexes && \
echo 'APT::Get::Install-Recommends "false"; APT::Get::Install-Suggests "false";' > apt.conf.d/docker-recommends && \
- echo "deb [arch=amd64] $UBUNTU_MIRROR_URL xenial main restricted universe multiverse" >> sources.list && \
- echo "deb [arch=amd64] $UBUNTU_MIRROR_URL xenial-updates main restricted universe multiverse" >> sources.list && \
- echo "deb [arch=amd64] $UBUNTU_MIRROR_URL xenial-backports main restricted universe multiverse" >> sources.list && \
+ echo "deb [arch=amd64] $UBUNTU_MIRROR_URL focal main restricted universe multiverse" >> sources.list && \
+ echo "deb [arch=amd64] $UBUNTU_MIRROR_URL focal-updates main restricted universe multiverse" >> sources.list && \
+ echo "deb [arch=amd64] $UBUNTU_MIRROR_URL focal-backports main restricted universe multiverse" >> sources.list && \
popd ; apt-get update && apt-get upgrade -y && \
- apt-get install -y build-essential curl git-core iputils-ping libffi-dev libldap2-dev libsasl2-dev libssl-dev patch python-dev python-pip python3-dev python3-pip vim-tiny wget \
- python-virtualenv \
-# Enable these packages while porting to Python3 => python3-virtualenv python3-dev \
+ apt-get install -y build-essential curl git-core iputils-ping libffi-dev libldap2-dev libsasl2-dev libssl-dev patch vim-tiny wget \
+ virtualenv python2.7 python2.7-dev python3.8 python3.8-dev python3-pip \
# Due to upstream bug we should use fixed version of pip
- && pip install -U pip==20.0.2 \
- && pip install tox \
+ && pip3 install -U pip==20.0.2 \
+ && pip3 install tox \
# initialize cvp stacklight test suite
&& mkdir cvp-stacklight \
&& pushd cvp-stacklight \
@@ -45,7 +45,6 @@
&& apt-get -y purge libx11-data xauth libxmuu1 libxcb1 libx11-6 libxext6 ppp pppconfig pppoeconf popularity-contest cpp gcc g++ libssl-doc && \
apt-get -y autoremove; apt-get -y clean ; rm -rf /root/.cache; rm -rf /var/lib/apt/lists/* && \
rm -rf /tmp/* ; rm -rf /var/tmp/* ; rm -rfv /etc/apt/sources.list.d/* ; echo > /etc/apt/sources.list \
-
# Download iperf package
&& wget http://ftp.br.debian.org/debian/pool/main/i/iperf/iperf_2.0.5+dfsg1-2_amd64.deb -O /var/lib/iperf_2.0.5+dfsg1-2_amd64.deb
diff --git a/test_set/cvp-sanity/requirements.txt b/test_set/cvp-sanity/requirements.txt
index 881d76e..7636877 100644
--- a/test_set/cvp-sanity/requirements.txt
+++ b/test_set/cvp-sanity/requirements.txt
@@ -1,10 +1,11 @@
-pytest==3.7.1
-pytest-rerunfailures==7.0
-requests==2.24.0
-flake8==3.8.3
-PyYAML==5.3.1
-python-jenkins==1.7.0
-pygerrit2==2.0.9
-GitPython==3.1.7
-ldap3==2.7
+pytest>=3.10
+pytest-rerunfailures>=7.0
+requests>=2.24.0
+flake8>=3.8.3
+PyYAML>=5.4
+python-jenkins>=1.7.0
+pygerrit2>=2.0.9
+GitPython>=3.1.7
+ldap3>=2.7
+
diff --git a/test_set/cvp-spt/requirements.txt b/test_set/cvp-spt/requirements.txt
index 294aece..6898f80 100644
--- a/test_set/cvp-spt/requirements.txt
+++ b/test_set/cvp-spt/requirements.txt
@@ -5,6 +5,6 @@
python-keystoneclient==3.22.0 # Apache-2.0
python-neutronclient==7.1.0 # Apache-2.0
python-novaclient==7.1.0
-PyYAML==5.3.1 # MIT
+PyYAML>=5.4 # MIT
requests==2.24.0 # Apache-2.0
-texttable==1.2.0
\ No newline at end of file
+texttable==1.2.0
diff --git a/test_set/tox.ini b/test_set/tox.ini
index b68781e..dee7131 100644
--- a/test_set/tox.ini
+++ b/test_set/tox.ini
@@ -10,7 +10,7 @@
commands = {posargs:pytest --version}
[testenv:cvp-sanity]
-basepython = python3.5
+basepython = python3.8
deps = -rcvp-sanity/requirements.txt
changedir = cvp-sanity