aboutsummaryrefslogtreecommitdiffstats
path: root/deployment/docker/src/main
diff options
context:
space:
mode:
authorKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2017-09-08 11:28:58 +0530
committerKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2017-09-08 16:43:15 +0530
commit1fb14913426397d0313890b357ad5bf6ad11f3c7 (patch)
tree010ffac7586c3c99aaa1806c2e12acea5c2ea38b /deployment/docker/src/main
parent635d08899576ff360a7ca52d6b2f17076670b6fc (diff)
Base docker image to openjdk:8-jre-slim
CLI-14 Change-Id: I1347393ebdeb643806f6fc7c78c9df12e97fd21f Signed-off-by: Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Diffstat (limited to 'deployment/docker/src/main')
-rw-r--r--deployment/docker/src/main/docker/Dockerfile47
1 files changed, 27 insertions, 20 deletions
diff --git a/deployment/docker/src/main/docker/Dockerfile b/deployment/docker/src/main/docker/Dockerfile
index 61ecd505..e333370c 100644
--- a/deployment/docker/src/main/docker/Dockerfile
+++ b/deployment/docker/src/main/docker/Dockerfile
@@ -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