From: Chuck Short Date: Fri, 14 Jul 2017 13:56:09 +0000 (-0500) Subject: Clean up Dockerfiles X-Git-Tag: v1.2.1~145^2 X-Git-Url: https://gerrit.onap.org/r/gitweb?p=sdnc%2Foam.git;a=commitdiff_plain;h=8e55ec48defbf3cf93faef4cb842481e9090fc09 Clean up Dockerfiles Follow Docker best practices guide located at: https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices Also try to improve readability of the Dockerfile Change-Id: I9ad061789fff4af2d21650783ab4659f54c729fa Signed-off-by: Chuck Short Former-commit-id: 20a1f5623a96bc4491dd7efdcb1ce03bd6ed1d28 --- diff --git a/installation/sdnc/src/main/docker/Dockerfile b/installation/sdnc/src/main/docker/Dockerfile index debfe834..37db15db 100644 --- a/installation/sdnc/src/main/docker/Dockerfile +++ b/installation/sdnc/src/main/docker/Dockerfile @@ -1,6 +1,8 @@ # Base ubuntu with added packages needed for open ecomp FROM openecomp/ubuntu-sdnc-image:${project.version} + MAINTAINER SDN-C Team (sdnc@lists.openecomp.org) + ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64 ENV ODL_HOME /opt/opendaylight/current ENV SDNC_CONFIG_DIR /opt/openecomp/sdnc/data/properties @@ -8,10 +10,10 @@ ENV SDNC_CONFIG_DIR /opt/openecomp/sdnc/data/properties # copy the opendaylight tar and expand COPY distribution-karaf-${sdnc.opendaylight.version}.tar.gz /tmp/ RUN mkdir /opt/opendaylight \ -&& tar zxvf /tmp/distribution-karaf-${sdnc.opendaylight.version}.tar.gz --directory /opt/opendaylight \ -&& rm -rf /tmp/distribution-karaf-${sdnc.opendaylight.version}.tar.gz \ -&& ln -s /opt/opendaylight/distribution-karaf-${sdnc.opendaylight.version} /opt/opendaylight/current \ -&& mkdir /opt/openecomp + && tar zxvf /tmp/distribution-karaf-${sdnc.opendaylight.version}.tar.gz --directory /opt/opendaylight \ + && rm -rf /tmp/distribution-karaf-${sdnc.opendaylight.version}.tar.gz \ + && ln -s /opt/opendaylight/distribution-karaf-${sdnc.opendaylight.version} /opt/opendaylight/current \ + && mkdir /opt/openecomp COPY idmlight.db.mv.db /opt/opendaylight/current @@ -22,5 +24,6 @@ RUN ln -s /opt/openecomp/sdnc /opt/sdnc # workaround till we get proxy working RUN mkdir -p /opt/opendaylight/current/system/mysql/mysql-connector-java/${sdnc.mysql-connector-java.version} COPY mysql-connector-java-${sdnc.mysql-connector-java.version}.jar /opt/opendaylight/current/system/mysql/mysql-connector-java/${sdnc.mysql-connector-java.version} + # ENTRYPOINT exec /opt/opendaylight/current/bin/karaf EXPOSE 8181 diff --git a/installation/ubuntu/src/main/docker/Dockerfile b/installation/ubuntu/src/main/docker/Dockerfile index 7d8e6eb3..d53240f3 100644 --- a/installation/ubuntu/src/main/docker/Dockerfile +++ b/installation/ubuntu/src/main/docker/Dockerfile @@ -12,4 +12,13 @@ RUN if [ ! -z ${HTTP_PROXY} ]; then echo "Acquire::http::proxy \"${HTTP_PROXY}\ if [ ! -z ${HTTPS_PROXY} ]; then echo "Acquire::https::proxy \"${HTTPS_PROXY}\";" >> /etc/apt/apt.conf; fi # Add tools needed for OpenDaylight -RUN apt-get update && apt-get install -y git openjdk-8-jdk maven mysql-client nodejs nodejs-legacy python-pip graphviz npm unzip +RUN apt-get update && apt-get install -y git \ + graphviz \ + openjdk-8-jdk \ + maven \ + mysql-client + nodejs \ + nodejs-legacy \ + npm \ + python-pip \ + unzip