Add deamon mode to dockerfile 87/8887/1
authorKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Mon, 28 Aug 2017 04:25:10 +0000 (09:55 +0530)
committerKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Mon, 28 Aug 2017 04:29:10 +0000 (09:59 +0530)
Helps to run docker in either console
mode(default) or deamon mode (by setting
env MODE=deamon

CLI-14
Change-Id: Iaa4adc2c5d20978ffa6c91bb270411cab7ff85a8
Signed-off-by: Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
README.md
deployment/docker/src/main/docker/Dockerfile

index 737cd04..5fc739a 100644 (file)
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@ One Command to command whole Onap !! It provides the unified commands
 to access and operate Onap functionalities. To use this CLI, please
 configure the following environment variables:
 
-1. ONAP_MSB_URL - Onap Micro service bus(MSB) URL
+1. ONAP_HOST_URL - Onap Micro service bus(MSB) URL or a service URL
 2. ONAP_USERNAME - Onap user name
 3. ONAP_PASSWORD - Onap user password
 
@@ -12,4 +12,8 @@ To know the CLI version, type onap [-v|--version]
 To know the CLI usage, type onap [-h|--help]
 To know the usage of sub commands, type onap <command> [-h|--help]
 
+To run in debug mode, set following environment variables:
+1. ONAP_CLI_DEBUG - By default its false, otherwise Set to true
+2. ONAP_CLI_DEBUG_PORT - By default it is 5005, otherwise set to new TCP port number
+
 To know more, please refer the Onap wiki https://wiki.onap.org
\ No newline at end of file
index 9146744..1b453de 100644 (file)
@@ -15,9 +15,20 @@ WORKDIR $ONAP_CLI_HOME
 RUN chmod +x ./bin/onap.sh
 RUN if [ ! -d ./data ]; then mkdir ./data; fi
 RUN if [ ! -d ./onap-cli-schema ]; then mkdir ./onap-cli-schema; fi
+RUN if [ ! -f /var/log/lighttpd/access.log ]; then touch /var/log/lighttpd/access.log; fi
 RUN ln ./bin/onap.sh /usr/sbin/onap
 
 EXPOSE 80
-ENTRYPOINT service lighttpd start && /bin/bash
+
+ENV ONAP_HOST_URL http://localhost:8080
+ENV ONAP_USERNAME guest
+ENV ONAP_PASSWORD guest
+ENV ONAP_CLI_DEBUG false
+ENV ONAP_CLI_DEBUG_PORT 5005
+ENV MODE console
+
+ENTRYPOINT cp /etc/lighttpd/conf-available/10-accesslog.conf /etc/lighttpd/conf-enabled/ && \
+           service lighttpd start && \
+           if [ "$MODE" = "deamon" ]; then tailf /var/log/lighttpd/access.log;else /bin/bash; fi
 
 RUN echo ONAP CLI docker successfully created !!
\ No newline at end of file