[VOL-5099] -- verify_voltha_onos_sanity_test failure
Dockerfile.voltha-onos
----------------------
o Several problem reports about the certificate installer available from
the base ubuntu 18.04 image. Reinstalled the ca-cert package for clean
state then regenerate zulujdk certificate causing problems for apt update.
Yes I did wash my hands after coding this one !
o We should be coding this into all Docker* files:
SHELL ["/bin/bash", "-euo", "pipefail", "-c"]
o Used RUN <<BANNER here document(s) to improve logging usability.
Difficult to follow logic flow for one-liners installing a b'zillion packges.
o Retained commented 'RUN <<FATAL' command near the bottom for posterity.
Very handy for forcing a hard stop while debugging
Change-Id: I6279bc8bb5394c616d886d44c8ce243f07fdb9e5
diff --git a/Dockerfile.voltha-onos b/Dockerfile.voltha-onos
index c48185a..54dd41d 100644
--- a/Dockerfile.voltha-onos
+++ b/Dockerfile.voltha-onos
@@ -12,10 +12,18 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-
# Download and copy the specified onos apps
FROM maven:3.6.3-openjdk-11-slim as download
+SHELL ["/bin/bash", "-euo", "pipefail", "-c"]
+
+RUN <<BANNER
+ echo ""
+ echo "** -----------------------------------------------------------------------"
+ echo "** Configure maven settings (./mvn_settings.sh)"
+ echo "** -----------------------------------------------------------------------"
+BANNER
+
# The ENV settings must be replicated below as they are not shared between stages
ENV DOWNLOAD_ROOT=/download
RUN mkdir -p ${DOWNLOAD_ROOT}
@@ -24,6 +32,14 @@
RUN ./mvn_settings.sh
ADD dependencies.xml .
+RUN <<BANNER
+ echo ""
+ echo "** -----------------------------------------------------------------------"
+ echo "** Copy onos artifacts into ${DOWNLOAD_ROOT}"
+ echo "** URL: https://maven.apache.org/plugins/maven-dependency-plugin/copy-mojo.html"
+ echo "** -----------------------------------------------------------------------"
+BANNER
+
ARG LOCAL_ONOSAPPS
COPY local_imports/ /local_imports/
RUN if [ -n "$LOCAL_ONOSAPPS" ] ; then \
@@ -32,7 +48,6 @@
mvn dependency:copy -Dmdep.useBaseVersion=true -DoutputDirectory=${DOWNLOAD_ROOT} -Dsilent=true -f dependencies.xml -s mvn_settings.xml ; \
fi
-
# Unpack and install specific apps from download stage
FROM onosproject/onos:2.5.8 as install
@@ -45,18 +60,34 @@
ENV DOWNLOAD_ROOT=/download
ENV APP_INSTALL_ROOT=/expand
+RUN <<BANNER
+ echo ""
+ echo "** -----------------------------------------------------------------------"
+ echo "** COPY --from=download ${DOWNLOAD_ROOT} ${DOWNLOAD_ROOT}"
+ echo "** -----------------------------------------------------------------------"
+BANNER
+
# Copy the downloaded artifact to the install stage container
COPY --from=download ${DOWNLOAD_ROOT} ${DOWNLOAD_ROOT}
+# https://askubuntu.com/questions/1095266/apt-get-update-failed-because-certificate-verification-failed-because-handshake
+RUN apt-get install --reinstall -y ca-certificates
+RUN rm /etc/apt/sources.list.d/zulu-openjdk.list && apt-get update
RUN apt-get update
RUN apt-get install unzip -y
+RUN <<BANNER
+ echo ""
+ echo "** -----------------------------------------------------------------------"
+ echo "** Install applications (./app-install.sh)"
+ echo "** -----------------------------------------------------------------------"
+BANNER
+
# Install the applications
COPY app-install.sh ./app-install.sh
RUN chmod 755 app-install.sh
RUN ./app-install.sh
-
# Create the final image coping over the installed applications from the install stage
FROM onosproject/onos:2.5.8
@@ -68,6 +99,13 @@
ENV APPS_ROOT=${ONOS}/apps
ENV JAVA_OPTS='-XX:+UseG1GC -XX:MaxGCPauseMillis=200 -XX:-UseContainerSupport -Dkaraf.log.console=INFO -Dds.lock.timeout.milliseconds=10000'
+RUN <<BANNER
+ echo ""
+ echo "** -----------------------------------------------------------------------"
+ echo "** COPY --from=install ${KARAF_M2}/ ${KARAF_M2}"
+ echo "** -----------------------------------------------------------------------"
+BANNER
+
COPY --from=install ${KARAF_M2}/ ${KARAF_M2}/
RUN echo "${KARAF_M2} ${APPS_ROOT}"
COPY --from=install ${APPS_ROOT}/ ${APPS_ROOT}/
@@ -105,4 +143,11 @@
org.label-schema.build-date=$org_label_schema_build_date \
org.opencord.vcs-commit-date=$org_opencord_vcs_commit_date
-# [EOF]
\ No newline at end of file
+## Inline as a debugging breakpoint
+# RUN <<FATAL
+# echo ""
+# echo "OUTA HERE"
+# exit 1
+#FATAL
+
+# [EOF]