aboutsummaryrefslogtreecommitdiffstats
path: root/deployment
diff options
context:
space:
mode:
authorKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2018-04-11 14:58:25 +0530
committerKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2018-04-11 15:00:20 +0530
commit1316fae7571a8d8d269032dfb1ba1e158d3cb53c (patch)
treea8f25b438bf7e8f612702175ec798d1ecf601148 /deployment
parentbcc754b16ceb6fe2ca4c4ea4c1f4f24662d440a3 (diff)
Docker: Combile all RUN into one sequence
Issue-ID: CLI-81 Change-Id: I4e185bc406b7a1d52b50a024c24aa7782c932e62 Signed-off-by: Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Diffstat (limited to 'deployment')
-rw-r--r--deployment/docker/src/main/docker/Dockerfile39
1 files changed, 13 insertions, 26 deletions
diff --git a/deployment/docker/src/main/docker/Dockerfile b/deployment/docker/src/main/docker/Dockerfile
index 729366fb..91ab0ed4 100644
--- a/deployment/docker/src/main/docker/Dockerfile
+++ b/deployment/docker/src/main/docker/Dockerfile
@@ -1,14 +1,5 @@
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 OPEN_CLI_HOME=/opt/oclip \
OPEN_CLI_DEBUG=false \
@@ -21,15 +12,19 @@ ENV OPEN_CLI_HOME=/opt/oclip \
ADD ./STAGE $OPEN_CLI_HOME
WORKDIR $OPEN_CLI_HOME
-#Setup the run time environment (RTE)
-#RTE: CLI
-RUN chmod +x ./bin/oclip.sh && \
- ln ./bin/oclip.sh /usr/sbin/oclip && \
- if [ ! -d ./data ]; then mkdir ./data; fi && \
- if [ ! -d ./open-cli-schema ]; then mkdir ./open-cli-schema; fi
-
-#Create the readable README
-RUN pandoc -t plain $OPEN_CLI_HOME/docs/README.md > $OPEN_CLI_HOME/docs/oclip-readme.txt
+RUN apt-get update && apt-get install -y lighttpd git curl pandoc vim && \
+ 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/ && \
+ pandoc -t plain $OPEN_CLI_HOME/docs/README.md > $OPEN_CLI_HOME/docs/oclip-readme.txt && \
+ 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/* && \
+ chmod +x $OPEN_CLI_HOME/bin/oclip.sh && \
+ ln $OPEN_CLI_HOME/bin/oclip.sh /usr/sbin/oclip && \
+ ln $OPEN_CLI_HOME/bin/oclip.sh /usr/sbin/onap && \
+ if [ ! -d $OPEN_CLI_HOME/data ]; then mkdir $OPEN_CLI_HOME/data; fi && \
+ if [ ! -d $OPEN_CLI_HOME/open-cli-schema ]; then mkdir $OPEN_CLI_HOME/open-cli-schema; fi && \
+ if [ ! -f /var/log/lighttpd/access.log ]; then touch /var/log/lighttpd/access.log; fi
#RTE: lighttpd
COPY ./STAGE/http/lighttpd/lighttpd.conf /etc/lighttpd/lighttpd.conf
@@ -37,9 +32,6 @@ COPY ./STAGE/http/web /var/www-data/servers/open-cli/
COPY ./STAGE/http/lighttpd/10-proxy.conf /etc/lighttpd/conf-enabled/
COPY ./STAGE/installer/cli-*.zip /var/www-data/servers/open-cli/oclip.zip
-RUN if [ ! -f /var/log/lighttpd/access.log ]; then touch /var/log/lighttpd/access.log; fi
-RUN cp /etc/lighttpd/conf-available/10-accesslog.conf /etc/lighttpd/conf-enabled/
-
EXPOSE 80
#RTE: gotty
@@ -47,8 +39,3 @@ EXPOSE 8080
#Start
ENTRYPOINT if [ "$OPEN_CLI_MODE" = "daemon" ]; then service lighttpd start; gotty --permit-write --reconnect oclip; else oclip -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 Open CLI docker successfully created !!