Base docker image to openjdk:8-jre-slim 75/11075/1
authorKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Fri, 8 Sep 2017 05:58:58 +0000 (11:28 +0530)
committerKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Fri, 8 Sep 2017 11:13:15 +0000 (16:43 +0530)
CLI-14
Change-Id: I1347393ebdeb643806f6fc7c78c9df12e97fd21f
Signed-off-by: Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
deployment/docker/pom.xml
deployment/docker/src/main/docker/Dockerfile

index e0056ec..e18d624 100644 (file)
                             <skipDockerTag>${skip.docker.tag}</skipDockerTag>
                         </configuration>
                     </execution>
+                    <execution>
+                        <id>tag-image-project-version</id>
+                        <phase>deploy</phase>
+                        <goals>
+                            <goal>tag</goal>
+                        </goals>
+                        <configuration>
+                            <image>${docker.image.name}</image>
+                            <newName>${docker.push.registry}/${docker.image.name}:${project.version}</newName>
+                            <pushImage>${skip.docker.push}</pushImage>
+                            <skipDockerTag>${skip.docker.tag}</skipDockerTag>
+                        </configuration>
+                    </execution>
                     <execution>
                         <id>tag-image-latest-version</id>
                         <phase>deploy</phase>
index 61ecd50..e333370 100644 (file)
@@ -1,15 +1,15 @@
-FROM ubuntu:14.04
-
-#installation
-RUN apt-get update
-RUN apt-get update && apt-get install -y software-properties-common
-RUN sudo -E add-apt-repository ppa:openjdk-r/ppa && apt-get update && apt-get install -y openjdk-8-jdk && apt-get install -y lighttpd && apt-get install -y git curl && apt-get install -y pandoc
-RUN cd /tmp && curl -O https://storage.googleapis.com/golang/go1.9.linux-amd64.tar.gz && tar -xvf go1.9.linux-amd64.tar.gz
-RUN mkdir -p /tmp/gotty && \
-  GOPATH=/tmp/gotty /tmp/go/bin/go get github.com/yudai/gotty && \
-  mv /tmp/gotty/bin/gotty /usr/sbin/ && rm /tmp/go1.9.linux-amd64.tar.gz && rm -rf /tmp/go /tmp/gotty && cd -
-
-ENV JAVA_HOME usr/lib/jvm/java-8-openjdk-amd64
+FROM openjdk:8-jre-slim
+
+#Setup default software
+RUN apt-get update && apt-get install -y lighttpd git curl pandoc vim
+
+#Setup gotty
+RUN cd /tmp && curl -O https://storage.googleapis.com/golang/go1.9.linux-amd64.tar.gz && \
+    tar -xvf go1.9.linux-amd64.tar.gz && mkdir -p /tmp/gotty && \
+    GOPATH=/tmp/gotty /tmp/go/bin/go get github.com/yudai/gotty && \
+    mv /tmp/gotty/bin/gotty /usr/sbin/
+
+#Environments
 ENV ONAP_CLI_HOME /opt/onap/cli
 ENV ONAP_CLI_DEBUG false
 ENV ONAP_CLI_DEBUG_PORT 5005
@@ -20,31 +20,38 @@ ENV ONAP_HOST_URL http://localhost:8080
 ENV ONAP_USERNAME guest
 ENV ONAP_PASSWORD guest
 
+#Copy CLI into docker
 ADD ./STAGE $ONAP_CLI_HOME
 WORKDIR $ONAP_CLI_HOME
 
-RUN chmod +x ./bin/onap.sh
-RUN ln ./bin/onap.sh /usr/sbin/onap
-RUN if [ ! -d ./data ]; then mkdir ./data; fi
-RUN if [ ! -d ./onap-cli-schema ]; then mkdir ./onap-cli-schema; fi
+#Setup the run time environment (RTE)
+#RTE: CLI
+RUN chmod +x ./bin/onap.sh  && \
+     ln ./bin/onap.sh /usr/sbin/onap  && \
+     if [ ! -d ./data ]; then mkdir ./data; fi  && \
+     if [ ! -d ./onap-cli-schema ]; then mkdir ./onap-cli-schema; fi
 
+#Create the readable README
 RUN pandoc -t plain $ONAP_CLI_HOME/docs/README.md > $ONAP_CLI_HOME/docs/onap-readme.txt
 
+#RTE: lighttpd
 COPY ./STAGE/http/lighttpd/lighttpd.conf /etc/lighttpd/lighttpd.conf
 COPY ./STAGE/http/web /var/www-data/servers/onap-cli/
-
+COPY ./STAGE/http/lighttpd/10-proxy.conf /etc/lighttpd/conf-enabled/
 COPY ./STAGE/installer/cli-*.zip /var/www-data/servers/onap-cli/onap-cli.zip
 
 RUN if [ ! -f /var/log/lighttpd/access.log ]; then touch /var/log/lighttpd/access.log; fi
-COPY ./STAGE/http/lighttpd/10-proxy.conf /etc/lighttpd/conf-enabled/
 RUN cp /etc/lighttpd/conf-available/10-accesslog.conf /etc/lighttpd/conf-enabled/
 
-#Lighttpd
 EXPOSE 80
 
-#gotty
+#RTE: gotty
 EXPOSE 8080
 
+#Start
 ENTRYPOINT if [ "$CLI_MODE" = "daemon" ]; then service lighttpd start; gotty --permit-write --reconnect onap; else onap -v && /bin/bash; fi
 
+#Cleanup
+RUN apt-get purge -y pandoc && apt-get autoremove -y && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/go /tmp/gotty /tmp/* /var/tmp/*
+
 RUN echo ONAP CLI docker successfully created !!
\ No newline at end of file