Feature 10296

Update dockerfiles to fetch dependencies from Artifactory
.deb and using pip3 -r instead of apt to resolve all upstream
depenencies

Update stage_3 to use URLs for artifactory packages instead
of apt server for installation of packages

Change-Id: I3abb1e1314862f386fb090cb18429f4283b0273d
Signed-off-by: beierlm <mark.beierl@canonical.com>
diff --git a/docker/Keystone/Makefile b/docker/Keystone/Makefile
deleted file mode 100644
index 2a4529e..0000000
--- a/docker/Keystone/Makefile
+++ /dev/null
@@ -1,21 +0,0 @@
-# Copyright 2018 Whitestack, LLC
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-#
-# For those usages not covered by the Apache License, Version 2.0 please
-# contact: esousa@whitestack.com or glavado@whitestack.com
-##
-
-include ../mk/Makefile.include
-
-MDG=$(shell basename $(CURDIR))
diff --git a/docker/LCM/Dockerfile b/docker/LCM/Dockerfile
index 34e753a..0038e78 100644
--- a/docker/LCM/Dockerfile
+++ b/docker/LCM/Dockerfile
@@ -16,47 +16,24 @@
 
 ########################################################################
 
-# This creates som/LCM docker from from last stable package
+FROM ubuntu:18.04 as INSTALL
 
-FROM ubuntu:18.04
+RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
+    DEBIAN_FRONTEND=noninteractive apt-get --yes install \
+    gcc=4:7.4.0-1ubuntu2.3 \
+    python3=3.6.7-1~18.04 \
+    python3-dev=3.6.7-1~18.04 \
+    python3-setuptools=39.0.1-2 \
+    curl=7.58.0-2ubuntu3.13 && \
+    python3 -m easy_install pip==21.0.1
 
-# Set the working directory to /app
-WORKDIR /app/osm_lcm
+RUN DEBIAN_FRONTEND=noninteractive apt-get --yes install \
+    apt-transport-https=1.6.12ubuntu0.2 \
+    gnupg2=2.2.4-1ubuntu1.4
 
-# avoid extra information from packages
-RUN echo 'path-exclude /usr/share/doc/*\n\
-path-include /usr/share/doc/*/copyright\n\
-path-exclude /usr/share/man/*\n\
-path-exclude /usr/share/groff/*\n\
-path-exclude /usr/share/info/*\n\
-path-exclude /usr/share/lintian/*\n\
-path-exclude /usr/share/linda/*\n'\
-> /etc/dpkg/dpkg.cfg.d/01_nodoc && \
-    echo  'APT::Install-Recommends "false";\n\
-APT::AutoRemove::RecommendsImportant "false";\n\
-APT::AutoRemove::SuggestsImportant "false";\n'\
-> /etc/apt/apt.conf.d/99_norecommends
-
-RUN apt-get update && apt-get -y install curl software-properties-common
-
-RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y git make python3 \
-    gpg-agent python3-pip  \
-    python3-all python3-setuptools openssh-client libffi-dev libssl-dev \
-    wget tox python3-cffi \
-    && python3 -m pip install -U pip \
-    && python3 -m pip install -U juju==2.8.4 \
-    && python3 -m pip install -U kubernetes==10.0.1 \
-    && rm -rf /var/lib/apt/lists/*
-
-# RUN git clone https://osm.etsi.org/gerrit/osm/N2VC.git \
-#     && cd N2VC \
-#     && cd modules/libjuju && python3 setup.py develop && cd ../.. \
-#     && python3 -m pip install -U -r requirements.txt
-
-RUN apt-get update && apt-get install -y curl xz-utils apt-transport-https \
-    && curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - \
+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 \
-    && apt-get update && apt-get install -y kubectl
+    && apt-get update && apt-get install -y kubectl=1.20.4-00
 
 RUN curl https://get.helm.sh/helm-v2.15.2-linux-amd64.tar.gz --output helm-v2.15.2.tar.gz \
     && tar -zxvf helm-v2.15.2.tar.gz \
@@ -72,30 +49,39 @@
     && tar -xvf juju-2.7.6-k8s.tar.xz \
     && mv juju /usr/local/bin/juju
 
-ARG REPOSITORY_BASE=http://osm-download.etsi.org/repository/osm/debian
-ARG RELEASE=ReleaseNINE-daily
-ARG REPOSITORY_KEY=OSM%20ETSI%20Release%20Key.gpg
-ARG REPOSITORY=testing
 
-RUN curl ${REPOSITORY_BASE}/${RELEASE}/${REPOSITORY_KEY} | apt-key add -
-RUN add-apt-repository -y "deb ${REPOSITORY_BASE}/${RELEASE} ${REPOSITORY} LCM N2VC common" && apt update
+ARG PYTHON3_OSM_COMMON_URL
+ARG PYTHON3_OSM_LCM_URL
+ARG PYTHON3_N2VC_URL
 
-RUN python3 -m pip install -U "cffi==1.13.2"
+RUN curl $PYTHON3_OSM_COMMON_URL -o osm_common.deb
+RUN dpkg -i ./osm_common.deb
 
-ARG LCM_VERSION
-ARG COMMON_VERSION
-ARG N2VC_VERSION
+RUN curl $PYTHON3_OSM_LCM_URL -o osm_lcm.deb
+RUN dpkg -i ./osm_lcm.deb
 
-RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
-     python3-osm-lcm${LCM_VERSION} \
-     python3-osm-common${COMMON_VERSION} \
-     python3-n2vc${N2VC_VERSION} \
-     && rm -rf /var/lib/apt/lists/*
+RUN curl $PYTHON3_N2VC_URL -o osm_n2vc.deb
+RUN dpkg -i ./osm_n2vc.deb
 
-LABEL Maintainer="alfonso.tiernosepulveda@telefonica.com" \
-      Description="This implements life cycle management engine for OSM" \
-      Version="1.0" \
-      Author="Alfonso Tierno"
+RUN pip3 install \
+    -r /usr/lib/python3/dist-packages/osm_common/requirements.txt \
+    -r /usr/lib/python3/dist-packages/osm_lcm/requirements.txt \
+    -r /usr/lib/python3/dist-packages/n2vc/requirements.txt
+
+FROM ubuntu:18.04
+
+RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
+    DEBIAN_FRONTEND=noninteractive apt-get --yes install python3-minimal=3.6.7-1~18.04
+
+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/bin/kubectl /usr/bin/kubectl
+COPY --from=INSTALL /usr/local/bin/helm /usr/local/bin/helm
+COPY --from=INSTALL /usr/local/bin/helm3 /usr/local/bin/helm3
+COPY --from=INSTALL /usr/local/bin/juju /usr/local/bin/juju
+
+########################################################################
 
 # Used for local storage
 VOLUME /app/storage
diff --git a/docker/LCM/Makefile b/docker/LCM/Makefile
deleted file mode 100644
index d64462a..0000000
--- a/docker/LCM/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-include ../mk/Makefile.include
-
-MDG=$(shell basename $(CURDIR))
diff --git a/docker/MON/Dockerfile b/docker/MON/Dockerfile
index eefb5fb..c25e6d2 100644
--- a/docker/MON/Dockerfile
+++ b/docker/MON/Dockerfile
@@ -20,48 +20,43 @@
 # contact: bdiaz@whitestack.com or glavado@whitestack.com
 ##
 
-FROM ubuntu:20.04
+FROM ubuntu:20.04 as INSTALL
 
-LABEL authors="Guillermo Calvino"
+RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
+    DEBIAN_FRONTEND=noninteractive apt-get --yes install \
+    curl=7.68.0-1ubuntu2.4 \
+    gcc=4:9.3.0-1ubuntu2 \
+    python3=3.8.2-0ubuntu2 \
+    python3-setuptools=45.2.0-1 \
+    python3-dev=3.8.2-0ubuntu2 && \
+    python3 -m easy_install pip==21.0.1
 
-RUN apt-get update \
-    && DEBIAN_FRONTEND=noninteractive apt-get install -y curl \
-                          software-properties-common \
-                          git \
-                          python3 \
-                          python3-pip \
-                          libssl-dev \
-                          libffi-dev \
-    && apt-get clean \
-    && rm -rf /var/lib/apt/lists/* \
-    && python3 -m pip install --upgrade pip
-RUN python3 --version && pip --version
+ARG PYTHON3_OSM_COMMON_URL
+ARG PYTHON3_OSM_MON_URL
+ARG PYTHON3_N2VC_URL
 
-RUN python3 -m pip install 'pyyaml>=5.1.2' 'paramiko' 'chardet==3.0.4' \
-          'lxml==4.6.2' 'humanfriendly==9.0.*' 'aiokafka>=0.7.0' \
-          'prometheus_client==0.4.*' 'python-keystoneclient==3.15.*' \
-          'six==1.15.0' 'requests==2.25.*' 'gnocchiclient==7.0.*' \
-          'pyvcloud==23.0.*' 'python-novaclient==12.0.*' \
-          'python-ceilometerclient==2.9.*' 'python-neutronclient==5.1.*'
+RUN curl $PYTHON3_OSM_COMMON_URL -o osm_common.deb
+RUN dpkg -i ./osm_common.deb
 
-ARG REPOSITORY_BASE=http://osm-download.etsi.org/repository/osm/debian
-ARG RELEASE=ReleaseNINE-daily
-ARG REPOSITORY_KEY=OSM%20ETSI%20Release%20Key.gpg
-ARG REPOSITORY=testing
+RUN curl $PYTHON3_N2VC_URL -o n2vc.deb
+RUN dpkg -i ./n2vc.deb
 
-ARG MON_VERSION
-ARG COMMON_VERSION
-ARG N2VC_VERSION
+RUN curl $PYTHON3_OSM_MON_URL -o osm_mon.deb
+RUN dpkg -i ./osm_mon.deb
 
-RUN curl ${REPOSITORY_BASE}/${RELEASE}/${REPOSITORY_KEY} | apt-key add - \
-    && add-apt-repository -y "deb ${REPOSITORY_BASE}/${RELEASE} ${REPOSITORY} MON N2VC common" \
-    && apt update \
-    && DEBIAN_FRONTEND=noninteractive apt-get -y install python3-osm-common${COMMON_VERSION} \
-                          python3-osm-mon${MON_VERSION} \
-                          python3-n2vc${N2VC_VERSION}
+RUN pip3 install \
+    -r /usr/lib/python3/dist-packages/n2vc/requirements.txt \
+    -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
 
-RUN python3 -m pip install -U "juju==2.8.4"
+RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
+    DEBIAN_FRONTEND=noninteractive apt-get --yes install python3-minimal=3.8.2-0ubuntu2
+
+COPY --from=INSTALL /usr/lib/python3/dist-packages /usr/lib/python3/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 scripts/ scripts/
 
diff --git a/docker/MON/Makefile b/docker/MON/Makefile
deleted file mode 100644
index d64462a..0000000
--- a/docker/MON/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-include ../mk/Makefile.include
-
-MDG=$(shell basename $(CURDIR))
diff --git a/docker/Makefile b/docker/Makefile
deleted file mode 100644
index a3b4028..0000000
--- a/docker/Makefile
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-#   Copyright 2017 Sandvine
-#   Copyright 2020 ETSI
-#
-#   Licensed under the Apache License, Version 2.0 (the "License");
-#   you may not use this file except in compliance with the License.
-#   You may obtain a copy of the License at
-#
-#       http://www.apache.org/licenses/LICENSE-2.0
-#
-#   Unless required by applicable law or agreed to in writing, software
-#   distributed under the License is distributed on an "AS IS" BASIS,
-#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#   See the License for the specific language governing permissions and
-#   limitations under the License.
-#
-SUBDIRS = MON NBI osmclient RO LCM light-ui POL Keystone NG-UI PLA tests
-include mk/dirs.mk
diff --git a/docker/NBI/Dockerfile b/docker/NBI/Dockerfile
index c8ac78f..d32c712 100644
--- a/docker/NBI/Dockerfile
+++ b/docker/NBI/Dockerfile
@@ -16,43 +16,45 @@
 
 ########################################################################
 
-# This creates osm/NBI docker from local NBI source code
+FROM ubuntu:18.04 as INSTALL
 
-FROM ubuntu:18.04
+RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
+    DEBIAN_FRONTEND=noninteractive apt-get --yes install \
+    gcc=4:7.4.0-1ubuntu2.3 \
+    python3=3.6.7-1~18.04 \
+    python3-dev=3.6.7-1~18.04 \
+    python3-setuptools=39.0.1-2 \
+    curl=7.58.0-2ubuntu3.13 && \
+    python3 -m easy_install pip==21.0.1
 
-RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install curl software-properties-common
+ARG PYTHON3_OSM_COMMON_URL
+ARG PYTHON3_OSM_IM_URL
+ARG PYTHON3_OSM_NBI_URL
 
-RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y git python3 python3-dev python3-pip
+RUN curl $PYTHON3_OSM_COMMON_URL -o osm_common.deb
+RUN dpkg -i ./osm_common.deb
 
-RUN python3 -m pip install --upgrade pip
+RUN curl $PYTHON3_OSM_IM_URL -o osm_im.deb
+RUN dpkg -i ./osm_im.deb
 
-RUN DEBIAN_FRONTEND=noninteractive apt-get install -y rustc cargo
+RUN curl $PYTHON3_OSM_NBI_URL -o osm_nbi.deb
+RUN dpkg -i ./osm_nbi.deb
 
-RUN python3 --version && python3 -m pip --version
+RUN pip3 install \
+    -r /usr/lib/python3/dist-packages/osm_common/requirements.txt \
+    -r /usr/lib/python3/dist-packages/osm_im/requirements.txt \
+    -r /usr/lib/python3/dist-packages/osm_nbi/requirements.txt
 
-RUN rustc --version && cargo --version
+FROM ubuntu:18.04 as FINAL
 
-RUN python3 -m pip install --upgrade setuptools setuptools-rust
+RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
+    DEBIAN_FRONTEND=noninteractive apt-get --yes install python3-minimal=3.6.7-1~18.04
 
-RUN python3 -m pip install --upgrade aiokafka dataclasses python-keystoneclient pymongo jsonschema \
-                                     aiohttp cherrypy==18.1.2 pyangbind keystoneauth1 \
-    && mkdir -p /app/storage/kafka && mkdir -p /app/log
+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
 
-ARG REPOSITORY_BASE=http://osm-download.etsi.org/repository/osm/debian
-ARG RELEASE=ReleaseNINE-daily
-ARG REPOSITORY_KEY=OSM%20ETSI%20Release%20Key.gpg
-ARG REPOSITORY=testing
+RUN mkdir -p /app/storage/kafka && mkdir -p /app/log
 
-RUN curl ${REPOSITORY_BASE}/${RELEASE}/${REPOSITORY_KEY} | apt-key add -
-RUN add-apt-repository -y "deb ${REPOSITORY_BASE}/${RELEASE} ${REPOSITORY} NBI IM common" && apt update
-
-ARG NBI_VERSION
-ARG COMMON_VERSION
-ARG IM_VERSION
-
-RUN apt-get update &&DEBIAN_FRONTEND=noninteractive apt-get -y install python3-osm-nbi${NBI_VERSION} python3-osm-common${COMMON_VERSION} python3-osm-im${IM_VERSION}
-
-# Set the working directory to /app
 WORKDIR /app/osm_nbi
 
 EXPOSE 9999
@@ -61,11 +63,6 @@
 RUN cp /usr/lib/python3/dist-packages/osm_nbi/nbi.cfg /app/osm_nbi/
 RUN cp -R /usr/lib/python3/dist-packages/osm_nbi/http /app/osm_nbi/
 
-LABEL Maintainer="alfonso.tiernosepulveda@telefonica.com" \
-      Description="This implements a north bound interface for OSM" \
-      Version="1.0" \
-      Author="Alfonso Tierno"
-
 # Used for local storage
 VOLUME /app/storage
 # Used for logs
diff --git a/docker/NBI/Makefile b/docker/NBI/Makefile
deleted file mode 100644
index d64462a..0000000
--- a/docker/NBI/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-include ../mk/Makefile.include
-
-MDG=$(shell basename $(CURDIR))
diff --git a/docker/NG-UI/Dockerfile b/docker/NG-UI/Dockerfile
index 15e837f..1741647 100644
--- a/docker/NG-UI/Dockerfile
+++ b/docker/NG-UI/Dockerfile
@@ -15,25 +15,24 @@
 
 FROM ubuntu:18.04
 
-RUN apt-get update && apt-get install -y curl xz-utils gnupg2 \
-    && apt-get update && apt-get install -y apt-transport-https software-properties-common \
-    && 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 \
-    && echo "deb-src 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 \
-    && apt-get install -y nginx
+RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
+    DEBIAN_FRONTEND=noninteractive apt-get --yes install \
+    apt-transport-https=1.6.12ubuntu0.2 \
+    curl=7.58.0-2ubuntu3.13 \
+    gnupg2=2.2.4-1ubuntu1.4 \
+    nginx=1.14.0-0ubuntu1.7 \
+    software-properties-common=0.96.24.32.14 \
+    xz-utils=5.2.2-1.3
 
-ARG REPOSITORY_BASE=http://osm-download.etsi.org/repository/osm/debian
-ARG RELEASE=ReleaseNINE-daily
-ARG REPOSITORY_KEY=OSM%20ETSI%20Release%20Key.gpg
-ARG REPOSITORY=testing
-ARG NGUI_VERSION
+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.0-1nodesource1
 
-RUN curl ${REPOSITORY_BASE}/${RELEASE}/${REPOSITORY_KEY} | apt-key add -
-RUN add-apt-repository -y "deb ${REPOSITORY_BASE}/${RELEASE} ${REPOSITORY} NG-UI" && apt-get update
+ARG OSM_NGUI_URL
 
-RUN apt-get install -y osm-ngui${NGUI_VERSION} && \
-    rm -rf /var/lib/apt/lists/*
+RUN curl $OSM_NGUI_URL -o osm_ngui.deb
+RUN dpkg -i ./osm_ngui.deb
 
 WORKDIR /usr/share/osm-ngui
 RUN npm install
@@ -55,4 +54,3 @@
 
 # Starting server.
 CMD ["nginx", "-g", "daemon off;"]
-
diff --git a/docker/NG-UI/Makefile b/docker/NG-UI/Makefile
deleted file mode 100644
index 0fb388b..0000000
--- a/docker/NG-UI/Makefile
+++ /dev/null
@@ -1,19 +0,0 @@
-##
-# Copyright 2020 ETSI
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-##
-
-include ../mk/Makefile.include
-
-MDG=$(shell basename $(CURDIR))
diff --git a/docker/PLA/Dockerfile b/docker/PLA/Dockerfile
index 8c2f97f..f3c3eb1 100644
--- a/docker/PLA/Dockerfile
+++ b/docker/PLA/Dockerfile
@@ -13,40 +13,51 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-FROM ubuntu:18.04
+FROM ubuntu:18.04 as INSTALL
 
-LABEL authors="Lars-Göran Magnusson"
+RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
+    DEBIAN_FRONTEND=noninteractive apt-get --yes install \
+    gcc=4:7.4.0-1ubuntu2.3 \
+    python3=3.6.7-1~18.04 \
+    python3-dev=3.6.7-1~18.04 \
+    python3-setuptools=39.0.1-2 \
+    curl=7.58.0-2ubuntu3.13 && \
+    python3 -m easy_install pip==21.0.1
 
-RUN apt-get --yes update \
- &&DEBIAN_FRONTEND=noninteractive apt-get --yes install git python python-pip python3 python3-pip libmysqlclient-dev libssl-dev libffi-dev \
- &&DEBIAN_FRONTEND=noninteractive apt-get --yes install mysql-client curl software-properties-common libgl1-mesa-glx \
- && python3 -m pip install -U pip \
- && python3 -m pip install pymzn==0.18.3
+ARG PYTHON3_OSM_COMMON_URL
+ARG PYTHON3_OSM_PLA_URL
 
-ARG REPOSITORY_BASE=http://osm-download.etsi.org/repository/osm/debian
-ARG RELEASE=ReleaseNINE-daily
-ARG REPOSITORY_KEY=OSM%20ETSI%20Release%20Key.gpg
-ARG REPOSITORY=testing
+RUN curl $PYTHON3_OSM_COMMON_URL -o osm_common.deb
+RUN dpkg -i ./osm_common.deb
 
-RUN curl ${REPOSITORY_BASE}/${RELEASE}/${REPOSITORY_KEY} | apt-key add -
-RUN add-apt-repository -y "deb ${REPOSITORY_BASE}/${RELEASE} ${REPOSITORY} PLA common" && apt update
+RUN curl $PYTHON3_OSM_PLA_URL -o osm_pla.deb
+RUN dpkg -i ./osm_pla.deb
 
-ARG PLA_VERSION
-ARG COMMON_VERSION
-
-RUN apt-get --yes update  && DEBIAN_FRONTEND=noninteractive apt-get -y install python3-osm-common${COMMON_VERSION} python3-osm-pla${PLA_VERSION}
-
-COPY scripts/ scripts/
+RUN pip3 install \
+    -r /usr/lib/python3/dist-packages/osm_common/requirements.txt \
+    -r /usr/lib/python3/dist-packages/osm_pla/requirements.txt
 
 ADD https://github.com/MiniZinc/MiniZincIDE/releases/download/2.4.2/MiniZincIDE-2.4.2-bundle-linux-x86_64.tgz /minizinc.tgz
 
 RUN tar -zxf /minizinc.tgz && \
     mv /MiniZincIDE-2.4.2-bundle-linux /minizinc
 
+FROM ubuntu:18.04
+LABEL authors="Lars-Göran Magnusson"
+
+RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
+    DEBIAN_FRONTEND=noninteractive apt-get --yes install python3-minimal=3.6.7-1~18.04
+
+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/bin/osm* /usr/bin/
+COPY --from=INSTALL /minizinc /minizinc
+
 RUN mkdir /entry_data \
     && mkdir /entry_data/mzn-lib \
     && ln -s /entry_data/mzn-lib /minizinc/share/minizinc/exec
 
+COPY scripts/ scripts/
 RUN mkdir /placement
 
 ENV OSMPLA_MESSAGE_DRIVER kafka
diff --git a/docker/PLA/Makefile b/docker/PLA/Makefile
deleted file mode 100644
index 8763aad..0000000
--- a/docker/PLA/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-# Copyright 2020 ETSI
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#    http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-# implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-include ../mk/Makefile.include
-
-MDG=$(shell basename $(CURDIR))
diff --git a/docker/POL/Dockerfile b/docker/POL/Dockerfile
index f143b62..0c25583 100644
--- a/docker/POL/Dockerfile
+++ b/docker/POL/Dockerfile
@@ -20,30 +20,38 @@
 # contact: bdiaz@whitestack.com or glavado@whitestack.com
 ##
 
-FROM ubuntu:20.04
+FROM ubuntu:20.04 as INSTALL
 
-LABEL authors="Benjamín Díaz"
+RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
+    DEBIAN_FRONTEND=noninteractive apt-get --yes install \
+    curl=7.68.0-1ubuntu2.4 \
+    gcc=4:9.3.0-1ubuntu2 \
+    python3=3.8.2-0ubuntu2 \
+    python3-setuptools=45.2.0-1 \
+    python3-dev=3.8.2-0ubuntu2 && \
+    python3 -m easy_install pip==21.0.1
 
-RUN DEBIAN_FRONTEND=noninteractive apt-get -y update \
- && DEBIAN_FRONTEND=noninteractive apt-get -y install \
-    git python3 python3-pip libmysqlclient-dev libssl-dev libffi-dev \
-    mysql-client curl software-properties-common
+ARG PYTHON3_OSM_COMMON_URL
+ARG PYTHON3_OSM_POLICY_MODULE_URL
 
-RUN pip3 install pip==21.0.1
+RUN curl $PYTHON3_OSM_COMMON_URL -o osm_common.deb
+RUN dpkg -i ./osm_common.deb
 
-ARG REPOSITORY_BASE=http://osm-download.etsi.org/repository/osm/debian
-ARG RELEASE=ReleaseNINE-daily
-ARG REPOSITORY_KEY=OSM%20ETSI%20Release%20Key.gpg
-ARG REPOSITORY=testing
+RUN curl $PYTHON3_OSM_POLICY_MODULE_URL -o osm_policy_module.deb
+RUN dpkg -i ./osm_policy_module.deb
 
-RUN curl ${REPOSITORY_BASE}/${RELEASE}/${REPOSITORY_KEY} | apt-key add -
-RUN add-apt-repository -y "deb ${REPOSITORY_BASE}/${RELEASE} ${REPOSITORY} POL common" && apt update
+RUN pip3 install \
+    -r /usr/lib/python3/dist-packages/osm_common/requirements.txt \
+    -r /usr/lib/python3/dist-packages/osm_policy_module/requirements.txt
 
-ARG POL_VERSION
-ARG COMMON_VERSION
+FROM ubuntu:20.04 as FINAL
 
-RUN DEBIAN_FRONTEND=noninteractive apt-get -y update \
- && DEBIAN_FRONTEND=noninteractive apt-get -y install python3-osm-policy-module${POL_VERSION}
+RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
+    DEBIAN_FRONTEND=noninteractive apt-get --yes install python3-minimal=3.8.2-0ubuntu2
+
+COPY --from=INSTALL /usr/lib/python3/dist-packages /usr/lib/python3/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 scripts/ scripts/
 
diff --git a/docker/POL/Makefile b/docker/POL/Makefile
deleted file mode 100644
index e7833c5..0000000
--- a/docker/POL/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-include ../mk/Makefile.include
-
-MDG=$(shell basename $(CURDIR))
-CONTAINER_NAME=pol
diff --git a/docker/RO/Dockerfile b/docker/RO/Dockerfile
index 09281be..26c148b 100644
--- a/docker/RO/Dockerfile
+++ b/docker/RO/Dockerfile
@@ -16,43 +16,77 @@
 
 ########################################################################
 
+FROM ubuntu:18.04 as INSTALL
+
+RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
+    DEBIAN_FRONTEND=noninteractive apt-get --yes install \
+    gcc=4:7.4.0-1ubuntu2.3 \
+    python3=3.6.7-1~18.04 \
+    python3-dev=3.6.7-1~18.04 \
+    python3-setuptools=39.0.1-2 \
+    curl=7.58.0-2ubuntu3.13 && \
+    python3 -m easy_install pip==21.0.1
+
+RUN DEBIAN_FRONTEND=noninteractive apt-get --yes install \
+    genisoimage=9:1.1.11-3ubuntu2
+
+ARG PYTHON3_OSM_COMMON_URL
+ARG PYTHON3_OSM_NG_RO_URL
+ARG PYTHON3_OSM_RO_PLUGIN_URL
+ARG PYTHON3_OSM_ROSDN_ARISTA_CLOUDVISION_URL
+ARG PYTHON3_OSM_ROSDN_DPB_URL
+ARG PYTHON3_OSM_ROSDN_DYNPAC_URL
+ARG PYTHON3_OSM_ROSDN_FLOODLIGHTOF_URL
+ARG PYTHON3_OSM_ROSDN_IETFL2VPN_URL
+ARG PYTHON3_OSM_ROSDN_JUNIPER_CONTRAIL_URL
+ARG PYTHON3_OSM_ROSDN_ODLOF_URL
+ARG PYTHON3_OSM_ROSDN_ONOSOF_URL
+ARG PYTHON3_OSM_ROSDN_ONOS_VPLS_URL
+ARG PYTHON3_OSM_ROVIM_AWS_URL
+ARG PYTHON3_OSM_ROVIM_AZURE_URL
+ARG PYTHON3_OSM_ROVIM_FOS_URL
+ARG PYTHON3_OSM_ROVIM_OPENNEBULA_URL
+ARG PYTHON3_OSM_ROVIM_OPENSTACK_URL
+ARG PYTHON3_OSM_ROVIM_OPENVIM_URL
+ARG PYTHON3_OSM_ROVIM_VMWARE_URL
+
+RUN for URL in \
+    $PYTHON3_OSM_COMMON_URL \
+    $PYTHON3_OSM_NG_RO_URL \
+    $PYTHON3_OSM_RO_PLUGIN_URL \
+    $PYTHON3_OSM_ROSDN_ARISTA_CLOUDVISION_URL \
+    $PYTHON3_OSM_ROSDN_DPB_URL \
+    $PYTHON3_OSM_ROSDN_DYNPAC_URL \
+    $PYTHON3_OSM_ROSDN_FLOODLIGHTOF_URL \
+    $PYTHON3_OSM_ROSDN_IETFL2VPN_URL \
+    $PYTHON3_OSM_ROSDN_JUNIPER_CONTRAIL_URL \
+    $PYTHON3_OSM_ROSDN_ODLOF_URL \
+    $PYTHON3_OSM_ROSDN_ONOSOF_URL \
+    $PYTHON3_OSM_ROSDN_ONOS_VPLS_URL \
+    $PYTHON3_OSM_ROVIM_AWS_URL \
+    $PYTHON3_OSM_ROVIM_AZURE_URL \
+    $PYTHON3_OSM_ROVIM_FOS_URL \
+    $PYTHON3_OSM_ROVIM_OPENNEBULA_URL \
+    $PYTHON3_OSM_ROVIM_OPENSTACK_URL \
+    $PYTHON3_OSM_ROVIM_OPENVIM_URL \
+    $PYTHON3_OSM_ROVIM_VMWARE_URL ; do \
+        curl -s $URL -O ; \
+    done
+
+RUN dpkg -i *.deb
+
+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
 
-MAINTAINER Gennadiy Dubina <gennadiy.dubina@dataat.com>; Alfonso Tierno <alfonso.tiernosepulveda@telefoncia.com>
+RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
+    DEBIAN_FRONTEND=noninteractive apt-get --yes install python3-minimal=3.6.7-1~18.04
 
-RUN apt-get update && apt-get -y install curl software-properties-common git tox python3-pip \
-    && python3 -m pip install --upgrade pip && python3 -m pip install pyangbind networking-l2gw
-
-ARG REPOSITORY_BASE=http://osm-download.etsi.org/repository/osm/debian
-ARG RELEASE=ReleaseNINE-daily
-ARG REPOSITORY_KEY=OSM%20ETSI%20Release%20Key.gpg
-ARG REPOSITORY=testing
-
-RUN curl ${REPOSITORY_BASE}/${RELEASE}/${REPOSITORY_KEY} | apt-key add -
-RUN add-apt-repository -y "deb ${REPOSITORY_BASE}/${RELEASE} ${REPOSITORY} RO IM common" && apt-get update
-
-ARG RO_VERSION
-ARG COMMON_VERSION
-
-RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y python3-osm-common${COMMON_VERSION} \
-    python3-osm-ro-plugin${RO_VERSION} python3-osm-ng-ro${RO_VERSION} \
-    python3-osm-rosdn-arista-cloudvision${RO_VERSION} python3-osm-rosdn-dpb${RO_VERSION} \
-    python3-osm-rosdn-dynpac${RO_VERSION} python3-osm-rosdn-floodlightof${RO_VERSION} \
-    python3-osm-rosdn-ietfl2vpn${RO_VERSION}  python3-osm-rosdn-juniper-contrail${RO_VERSION} \
-    python3-osm-rosdn-odlof${RO_VERSION} python3-osm-rosdn-onos-vpls${RO_VERSION} \
-    python3-osm-rosdn-onosof${RO_VERSION} \
-    python3-osm-rovim-aws${RO_VERSION} python3-osm-rovim-azure${RO_VERSION} \
-    python3-osm-rovim-fos${RO_VERSION} python3-osm-rovim-opennebula${RO_VERSION} \
-    python3-osm-rovim-openstack${RO_VERSION} python3-osm-rovim-openvim${RO_VERSION} \
-    python3-osm-rovim-vmware${RO_VERSION}
-
-# ensure right version is installed as python3-cryptography install an old version
-# Since release 3.4 of python3-cryptography rust is an dependency
-
-RUN DEBIAN_FRONTEND=noninteractive apt-get -y install build-essential libssl-dev libffi-dev \
-    python3-dev cargo
-
-RUN python3 -m pip install --upgrade "cryptography>=2.5"
+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/bin/genisoimage /usr/bin/genisoimage
 
 VOLUME /var/log/osm
 
@@ -97,7 +131,6 @@
 
 HEALTHCHECK --start-period=130s --interval=10s --timeout=5s --retries=12 \
   CMD curl --silent --fail http://localhost:9090/ro || exit 1
-  # CMD curl --silent --fail localhost:9090/openmano/tenants || exit 1
-# CMD /usr/bin/RO-start.sh
+
 CMD ["python3", "-u", "-m", "osm_ng_ro.ro_main"]
 
diff --git a/docker/RO/Makefile b/docker/RO/Makefile
deleted file mode 100644
index d64462a..0000000
--- a/docker/RO/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-include ../mk/Makefile.include
-
-MDG=$(shell basename $(CURDIR))
diff --git a/docker/light-ui/Makefile b/docker/light-ui/Makefile
deleted file mode 100644
index d64462a..0000000
--- a/docker/light-ui/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-include ../mk/Makefile.include
-
-MDG=$(shell basename $(CURDIR))
diff --git a/docker/mk/Makefile.include b/docker/mk/Makefile.include
deleted file mode 100644
index f31d2ca..0000000
--- a/docker/mk/Makefile.include
+++ /dev/null
@@ -1,89 +0,0 @@
-#
-#   Copyright 2020 ETSI
-#
-#   Licensed under the Apache License, Version 2.0 (the "License");
-#   you may not use this file except in compliance with the License.
-#   You may obtain a copy of the License at
-#
-#       http://www.apache.org/licenses/LICENSE-2.0
-#
-#   Unless required by applicable law or agreed to in writing, software
-#   distributed under the License is distributed on an "AS IS" BASIS,
-#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#   See the License for the specific language governing permissions and
-#   limitations under the License.
-#
-TOPDIR=$(shell readlink -f .|sed -e 's/\/docker\/.*//')
-MKINCLUDE=$(TOPDIR)/docker/mk
-MKBUILD=$(TOPDIR)/docker/build
-
-all: build
-
-TAG ?= 6
-
-REPOSITORY_BASE ?= http://osm-download.etsi.org/repository/osm/debian
-RELEASE         ?= ReleaseNINE-daily
-REPOSITORY_KEY  ?= OSM%20ETSI%20Release%20Key.gpg
-REPOSITORY      ?= testing
-NO_CACHE        ?= --no-cache
-DOCKER_REGISTRY     ?= ""
-
-LOWER_MDG = $(shell echo $(MDG) | tr '[:upper:]' '[:lower:]')
-
-CONTAINER_NAME ?= $(LOWER_MDG)
-
-CMD_DOCKER_ARGS ?= -q
-DOCKER_ARGS     = $(CMD_DOCKER_ARGS)
-
-DEPS := MON IM LCM RO common osmclient devops NBI policy-module Keystone N2VC lightui ngui PLA tests
-
-DEPS_TARGETS = $(addprefix $(MKBUILD)/.dep_, $(DEPS))
-
-Q=@
-
-$(MKBUILD):
-	$Qmkdir -p $(MKBUILD)
-
-$(MKBUILD)/.dep_policy-module:
-	$Q$(MKINCLUDE)/get_version.sh -r $(REPOSITORY) -R $(RELEASE) -k $(REPOSITORY_KEY) -u $(REPOSITORY_BASE) -m POL -p policy-module > $@
-
-$(MKBUILD)/.dep_lightui:
-	$Q$(MKINCLUDE)/get_version.sh -r $(REPOSITORY) -R $(RELEASE) -k $(REPOSITORY_KEY) -u $(REPOSITORY_BASE) -m LW-UI -p lightui > $@
-
-$(MKBUILD)/.dep_ngui:
-	$Q$(MKINCLUDE)/get_version.sh -r $(REPOSITORY) -R $(RELEASE) -k $(REPOSITORY_KEY) -u $(REPOSITORY_BASE) -m NG-UI -p ngui > $@
-
-$(MKBUILD)/.dep_%:
-	$Q$(MKINCLUDE)/get_version.sh -r $(REPOSITORY) -R $(RELEASE) -k $(REPOSITORY_KEY) -u $(REPOSITORY_BASE) -m $* > $@
-
-build: $(MKBUILD) $(DEPS_TARGETS)
-	$Qdocker build -t opensourcemano/$(LOWER_MDG):$(TAG) \
-                   --build-arg RELEASE=$(RELEASE) \
-                   --build-arg REPOSITORY=$(REPOSITORY) \
-                   --build-arg REPOSITORY_KEY=$(REPOSITORY_KEY) \
-                   --build-arg REPOSITORY_BASE=$(REPOSITORY_BASE) \
-                   --build-arg MON_VERSION==$(shell cat $(MKBUILD)/.dep_MON) \
-                   --build-arg IM_VERSION==$(shell cat $(MKBUILD)/.dep_IM) \
-                   --build-arg RO_VERSION==$(shell cat $(MKBUILD)/.dep_RO) \
-                   --build-arg LCM_VERSION==$(shell cat $(MKBUILD)/.dep_LCM) \
-                   --build-arg COMMON_VERSION==$(shell cat $(MKBUILD)/.dep_common) \
-                   --build-arg OSMCLIENT_VERSION==$(shell cat $(MKBUILD)/.dep_osmclient) \
-                   --build-arg NBI_VERSION==$(shell cat $(MKBUILD)/.dep_NBI) \
-                   --build-arg POL_VERSION==$(shell cat $(MKBUILD)/.dep_policy-module) \
-                   --build-arg PLA_VERSION==$(shell cat $(MKBUILD)/.dep_PLA) \
-                   --build-arg DEVOPS_VERSION==$(shell cat $(MKBUILD)/.dep_devops) \
-                   --build-arg N2VC_VERSION==$(shell cat $(MKBUILD)/.dep_N2VC) \
-                   --build-arg LWUI_VERSION==$(shell cat $(MKBUILD)/.dep_lightui) \
-                   --build-arg NGUI_VERSION==$(shell cat $(MKBUILD)/.dep_ngui) \
-                   --build-arg TESTS_VERSION==$(shell cat $(MKBUILD)/.dep_tests) \
-                   --build-arg CACHE_DATE==$(shell date -uI) \
-                   $(DOCKER_ARGS) .
-
-clean:
-	rm -f $(MKBUILD)/.dep*
-
-tag:
-	docker tag opensourcemano/$(CONTAINER_NAME):$(INPUT_TAG) $(DOCKER_REGISTRY)opensourcemano/$(LOWER_MDG):$(TAG)
-
-push: tag
-	docker push $(DOCKER_REGISTRY)opensourcemano/$(LOWER_MDG):$(TAG)
diff --git a/docker/mk/dirs.mk b/docker/mk/dirs.mk
deleted file mode 100644
index 0a3547a..0000000
--- a/docker/mk/dirs.mk
+++ /dev/null
@@ -1,53 +0,0 @@
-#
-#   Copyright 2017 Sandvine
-#
-#   Licensed under the Apache License, Version 2.0 (the "License");
-#   you may not use this file except in compliance with the License.
-#   You may obtain a copy of the License at
-#
-#       http://www.apache.org/licenses/LICENSE-2.0
-#
-#   Unless required by applicable law or agreed to in writing, software
-#   distributed under the License is distributed on an "AS IS" BASIS,
-#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#   See the License for the specific language governing permissions and
-#   limitations under the License.
-#
-
-TOPDIR=$(shell readlink -f .|sed -e 's/\/descriptor-packages\/.*//')
-TOOLS_DIR := $(TOPDIR)/tools
-
-SUBDIRS_CLEAN = $(addsuffix .clean, $(SUBDIRS))
-SUBDIRS_TEST = $(addsuffix .test, $(SUBDIRS))
-SUBDIRS_TAG = $(addsuffix .tag, $(SUBDIRS))
-SUBDIRS_PUSH = $(addsuffix .push, $(SUBDIRS))
-
-.PHONY: $(SUBDIRS) $(SUBDIRS_CLEAN) clean test tag push
-
-all: $(SUBDIRS)
-
-clean: $(SUBDIRS_CLEAN)
-
-test: $(SUBDIRS_TEST)
-
-tag: $(SUBDIRS_TAG)
-
-push: $(SUBDIRS_PUSH)
-
-$(SUBDIRS_CLEAN): %.clean:
-	@$(MAKE) --no-print-directory -C $* clean
-
-$(SUBDIRS_TEST): %.test:
-	@$(MAKE) --no-print-directory -C $* test
-
-$(SUBDIRS_TAG): %.tag:
-	@$(MAKE) --no-print-directory -C $* tag 
-
-$(SUBDIRS_PUSH): %.push:
-	@$(MAKE) --no-print-directory -C $* push
-
-$(SUBDIRS):
-	@$(MAKE) --no-print-directory -C $@
-
-test:
-	$(TOOLS_DIR)/launch_tests.sh
diff --git a/docker/mk/get_version.sh b/docker/mk/get_version.sh
deleted file mode 100755
index 2fae03a..0000000
--- a/docker/mk/get_version.sh
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/bin/sh
-#
-#   Copyright 2020 ETSI
-#
-#   Licensed under the Apache License, Version 2.0 (the "License");
-#   you may not use this file except in compliance with the License.
-#   You may obtain a copy of the License at
-#
-#       http://www.apache.org/licenses/LICENSE-2.0
-#
-#   Unless required by applicable law or agreed to in writing, software
-#   distributed under the License is distributed on an "AS IS" BASIS,
-#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#   See the License for the specific language governing permissions and
-#   limitations under the License.
-#
-
-RELEASE="ReleaseNINE-daily"
-REPOSITORY_KEY="OSM%20ETSI%20Release%20Key.gpg"
-REPOSITORY="testing"
-REPOSITORY_BASE="http://osm-download.etsi.org/repository/osm/debian"
-DEBUG=
-
-while getopts ":r:k:u:R:b:-:dm:p:" o; do
-    case "${o}" in
-        r)
-            REPOSITORY=${OPTARG}
-            ;;
-        R)
-            RELEASE=${OPTARG}
-            ;;
-        k)
-            REPOSITORY_KEY=${OPTARG}
-            ;;
-        u)
-            REPOSITORY_BASE=${OPTARG}
-            ;;
-        d)
-            DEBUG=y
-            ;;
-        p)
-            PACKAGE_NAME=${OPTARG}
-            ;;
-        m)
-            MDG=${OPTARG}
-            ;;
-        -)
-            ;;
-    esac
-done
-
-if [ -z "$MDG" ]; then
-    echo "missing MDG"
-fi
-
-[ -z "$PACKAGE_NAME" ] && PACKAGE_NAME=$MDG
-
-if [ -n "$DEBUG" ]; then
-    echo curl $REPOSITORY_BASE/$RELEASE/dists/$REPOSITORY/$MDG/binary-amd64/Packages
-fi
-
-curl $REPOSITORY_BASE/$RELEASE/dists/$REPOSITORY/$MDG/binary-amd64/Packages 2>/dev/null | awk -v pkg=$PACKAGE_NAME '{
-    if ( /Package:/ && match($2,sprintf("%s$",tolower(pkg)) ) ) {
-        package=1;
-    } else if (package==1 && match($1,"Version:")) { 
-        package=0; 
-        printf("%s\n", $2);
-    }
-}' | head -1
diff --git a/docker/osmclient/Dockerfile b/docker/osmclient/Dockerfile
index 68fa3e7..39b596d 100644
--- a/docker/osmclient/Dockerfile
+++ b/docker/osmclient/Dockerfile
@@ -1,47 +1,54 @@
-##
-# Copyright 2019 ETSI
+#######################################################################################
+# Copyright ETSI Contributors and Others.
 #
-# All Rights Reserved.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
 #
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
+#    http://www.apache.org/licenses/LICENSE-2.0
 #
 # Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-##
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#######################################################################################
 
+FROM ubuntu:18.04 as INSTALL
 
-FROM ubuntu:18.04
+RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
+    DEBIAN_FRONTEND=noninteractive apt-get --yes install \
+    gcc=4:7.4.0-1ubuntu2.3 \
+    python3=3.6.7-1~18.04 \
+    python3-dev=3.6.7-1~18.04 \
+    python3-setuptools=39.0.1-2 \
+    curl=7.58.0-2ubuntu3.13 && \
+    python3 -m easy_install pip==21.0.1
 
-MAINTAINER Gerardo Garcia <gerardo.garciadeblas@telefonica.com>; Jayant Madavi <JM00553988@techmahindra.com>
+RUN DEBIAN_FRONTEND=noninteractive apt-get --yes install \
+    libcurl4-openssl-dev=7.58.0-2ubuntu3.13
 
-RUN apt-get update && apt-get -y install curl software-properties-common
+ARG PYTHON3_OSMCLIENT_URL
+ARG PYTHON3_OSM_IM_URL
 
-RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install wget python3 python3-pip \
-    libcurl4-openssl-dev libssl-dev python3-openstackclient
+RUN curl $PYTHON3_OSMCLIENT_URL -o osmclient.deb
+RUN dpkg -i ./osmclient.deb
 
-RUN python3 -m pip install -U pip && python3 -m pip install pyyaml python-magic pyangbind pytest==4.6.3 verboselogs
+RUN curl $PYTHON3_OSM_IM_URL -o osm_im.deb
+RUN dpkg -i ./osm_im.deb
 
-ARG REPOSITORY_BASE=http://osm-download.etsi.org/repository/osm/debian
-ARG RELEASE=ReleaseNINE-daily
-ARG REPOSITORY_KEY=OSM%20ETSI%20Release%20Key.gpg
-ARG REPOSITORY=testing
+RUN pip3 install \
+    -r /usr/lib/python3/dist-packages/osmclient/requirements.txt \
+    -r /usr/lib/python3/dist-packages/osm_im/requirements.txt
 
-RUN curl ${REPOSITORY_BASE}/${RELEASE}/${REPOSITORY_KEY} | apt-key add -
-RUN add-apt-repository -y "deb ${REPOSITORY_BASE}/${RELEASE} ${REPOSITORY} devops osmclient IM" && apt-get update
+FROM ubuntu:18.04 as FINAL
 
-ARG OSMCLIENT_VERSION
-ARG DEVOPS_VERSION
-ARG IM_VERSION
+RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
+    DEBIAN_FRONTEND=noninteractive apt-get --yes install python3-minimal=3.6.7-1~18.04
 
-RUN apt-get update && apt-get -y install osm-devops${DEVOPS_VERSION} \
-    python3-osm-im${IM_VERSION} python3-osmclient${OSMCLIENT_VERSION}
+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
+
 ENV OSM_SOL005=True
-ENV OSM_HOSTNAME=nbi:9999
-
+ENV OSM_HOSTNAME=nbi:9999
\ No newline at end of file
diff --git a/docker/osmclient/Makefile b/docker/osmclient/Makefile
deleted file mode 100644
index d64462a..0000000
--- a/docker/osmclient/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-include ../mk/Makefile.include
-
-MDG=$(shell basename $(CURDIR))
diff --git a/docker/tests/Dockerfile b/docker/tests/Dockerfile
index 18ebe8e..66da9fa 100644
--- a/docker/tests/Dockerfile
+++ b/docker/tests/Dockerfile
@@ -13,52 +13,62 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+########################################################################
+
+FROM ubuntu:18.04 as INSTALL
+
+RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
+    DEBIAN_FRONTEND=noninteractive apt-get --yes install \
+    gcc=4:7.4.0-1ubuntu2.3 \
+    python3=3.6.7-1~18.04 \
+    python3-dev=3.6.7-1~18.04 \
+    python3-setuptools=39.0.1-2 \
+    curl=7.58.0-2ubuntu3.13 && \
+    python3 -m easy_install pip==21.0.1
+
+RUN DEBIAN_FRONTEND=noninteractive apt-get --yes install \
+    git=1:2.17.1-1ubuntu0.8 \
+    libcurl4-openssl-dev=7.58.0-2ubuntu3.13 \
+    libssl-dev=1.1.1-1ubuntu2.1~18.04.9
+
+ARG OSM_TESTS_URL
+ARG PYTHON3_OSM_IM_URL
+ARG PYTHON3_OSMCLIENT_URL
+
+RUN curl $PYTHON3_OSM_IM_URL -o osm_im.deb
+RUN dpkg -i ./osm_im.deb
+
+RUN curl $PYTHON3_OSMCLIENT_URL -o osmclient.deb
+RUN dpkg -i ./osmclient.deb
+
+RUN curl $OSM_TESTS_URL -o osm_tests.deb
+RUN dpkg -i ./osm_tests.deb
+
+
+RUN pip3 install \
+    -r /usr/lib/python3/dist-packages/osm_im/requirements.txt \
+    -r /usr/lib/python3/dist-packages/osmclient/requirements.txt \
+    -r /usr/share/osm-tests/requirements.txt
+
+RUN git clone \
+    https://osm.etsi.org/gitlab/vnf-onboarding/osm-packages.git \
+    --recurse-submodules \
+    /robot-systest/osm-packages
+
 FROM ubuntu:18.04
 
-RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install git software-properties-common \
-    curl xz-utils gnupg2 apt-transport-https make python3 debhelper python3-setuptools python3-pip apt-utils \
-    ssh iputils-ping libcurl4-openssl-dev libssl-dev python3-yaml \
-    build-essential libssl-dev libffi-dev python3-dev
-RUN add-apt-repository -y ppa:rmescandon/yq && apt update && apt install yq -y
+RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
+    DEBIAN_FRONTEND=noninteractive apt-get --yes install python3-minimal=3.6.7-1~18.04
 
-RUN python3 -m pip install --upgrade pip
+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
 
-RUN DEBIAN_FRONTEND=noninteractive apt-get install -y cargo rustc
-
-RUN python3 --version && python3 -m pip --version
-RUN rustc --version && cargo --version
-
-RUN python3 -m pip install --upgrade setuptools setuptools-rust
-
-RUN python3 -m pip install --ignore-installed pyyaml
-
-RUN python3 -m pip install --upgrade haikunator requests robotframework robotframework-seleniumlibrary \
-    robotframework-requests robotframework-jsonlibrary robotframework-sshlibrary charm-tools \
-    verboselogs pyangbind python-openstackclient
-
-ARG REPOSITORY_BASE=http://osm-download.etsi.org/repository/osm/debian
-ARG RELEASE=ReleaseNINE-daily
-ARG REPOSITORY_KEY=OSM%20ETSI%20Release%20Key.gpg
-ARG REPOSITORY=testing
-ARG TESTS_VERSION
-ARG IM_VERSION
-ARG OSMCLIENT_VERSION
-
-RUN curl ${REPOSITORY_BASE}/${RELEASE}/${REPOSITORY_KEY} | apt-key add -
-RUN add-apt-repository -y "deb ${REPOSITORY_BASE}/${RELEASE} ${REPOSITORY} tests osmclient IM" && apt-get update
-
-RUN apt-get install -y python3-osm-im${IM_VERSION} python3-osmclient${OSMCLIENT_VERSION}
-RUN apt-get install -y osm-tests${TESTS_VERSION} && \
-    rm -rf /var/lib/apt/lists/*
-
-RUN mv /usr/share/osm-tests/robot-systest /robot-systest
-RUN mv /usr/share/osm-tests/charm.sh /usr/sbin/charm
+COPY --from=INSTALL /usr/share/osm-tests/robot-systest /robot-systest
+COPY --from=INSTALL /usr/share/osm-tests/charm.sh /usr/sbin/charm
+COPY --from=INSTALL /robot-systest/osm-packages /robot-systest/osm-packages
 
 WORKDIR /robot-systest
 
-ARG CACHE_DATE=2021-03-01
-RUN git clone https://osm.etsi.org/gitlab/vnf-onboarding/osm-packages.git --recurse-submodules /robot-systest/osm-packages
-
 # Folder where Robot tests are stored
 ENV ROBOT_DEVOPS_FOLDER=/robot-systest
 
diff --git a/docker/tests/Makefile b/docker/tests/Makefile
deleted file mode 100644
index 0fb388b..0000000
--- a/docker/tests/Makefile
+++ /dev/null
@@ -1,19 +0,0 @@
-##
-# Copyright 2020 ETSI
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-##
-
-include ../mk/Makefile.include
-
-MDG=$(shell basename $(CURDIR))