-# packages needed for N2VC because deb dependencies are not fine
-RUN pip3 install 'macaroonbakery>=1.1,<2.0' 'pyRFC3339>=1.0,<2.0' \
- 'pyyaml>=3.0,<4.0' 'theblues>=0.3.8,<1.0' 'websockets>=4.0,<5.0' \
- 'paramiko' # PyNaCl
-#
-# RUN git clone https://osm.etsi.org/gerrit/osm/N2VC.git \
-# && cd N2VC \
-# && cd modules/libjuju && python3 setup.py develop && cd ../.. \
-# && pip3 install -U -r requirements.txt
-
-ARG REPOSITORY_BASE=http://osm-download.etsi.org/repository/osm/debian
-ARG RELEASE=ReleaseFOUR-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 LCM_VERSION
-ARG COMMON_VERSION
-ARG N2VC_VERSION
-
-RUN apt-get update && apt-get install -y python3-osm-lcm${LCM_VERSION} \
- python3-osm-common${COMMON_VERSION} \
- python3-n2vc${N2VC_VERSION} \
- && rm -rf /var/lib/apt/lists/*
-
-EXPOSE 9999
-
-LABEL Maintainer="alfonso.tiernosepulveda@telefonica.com" \
- Description="This implements life cycle management engine for OSM" \
- Version="1.0" \
- Author="Alfonso Tierno"
-
-# Used for local storage
-VOLUME /app/storage
-# Used for logs
-VOLUME /app/log
+COPY --from=INSTALL /usr/lib/python3/dist-packages /usr/lib/python3/dist-packages
+COPY --from=INSTALL /usr/local/lib/python3.10/dist-packages /usr/local/lib/python3.10/dist-packages
+
+#######################################################################################
+# End of common preparation
+
+RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
+ DEBIAN_FRONTEND=noninteractive apt-get --yes install \
+ ca-certificates \
+ && rm -rf /var/lib/apt/lists/*
+
+RUN rm -f /etc/apt/apt.conf.d/proxy.conf
+
+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/bin/scp /usr/bin/scp
+COPY --from=INSTALL /usr/bin/ssh-keygen /usr/bin/ssh-keygen
+COPY --from=INSTALL /usr/bin/ssh /usr/bin/ssh
+COPY --from=INSTALL /usr/lib/x86_64-linux-gnu/ /usr/lib/x86_64-linux-gnu/
+COPY --from=INSTALL /lib/x86_64-linux-gnu/ /lib/x86_64-linux-gnu/
+
+COPY scripts/ /app/osm_lcm/scripts/
+
+# Creating the user for the app
+RUN groupadd -g 1000 appuser && \
+ useradd -u 1000 -g 1000 -d /app appuser && \
+ mkdir -p /app/osm_lcm && \
+ mkdir -p /app/storage/kafka && \
+ mkdir /app/log && \
+ chown -R appuser:appuser /app && \
+ chown appuser: /etc/ssl/certs/ca-certificates.crt
+
+
+WORKDIR /app/osm_lcm
+
+# Changing the security context
+USER appuser
+
+########################################################################