Add occ
[cli.git] / deployment / docker / src / main / docker / Dockerfile
1 FROM ubuntu:14.04
2
3 #installation
4 RUN apt-get update
5 RUN apt-get update && apt-get install -y software-properties-common
6 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
7 RUN cd /tmp && curl -O https://storage.googleapis.com/golang/go1.9.linux-amd64.tar.gz && tar -xvf go1.9.linux-amd64.tar.gz
8 RUN mkdir -p /tmp/gotty && \
9   GOPATH=/tmp/gotty /tmp/go/bin/go get github.com/yudai/gotty && \
10   mv /tmp/gotty/bin/gotty /usr/sbin/ && rm /tmp/go1.9.linux-amd64.tar.gz && rm -rf /tmp/go /tmp/gotty && cd -
11
12 ENV JAVA_HOME usr/lib/jvm/java-8-openjdk-amd64
13 ENV ONAP_CLI_HOME /opt/onap/cli
14 ENV ONAP_CLI_DEBUG false
15 ENV ONAP_CLI_DEBUG_PORT 5005
16 ENV CLI_MODE console
17 ENV CLI_PRODUCT_VERSION cli-1.0
18
19 ENV ONAP_HOST_URL http://localhost:8080
20 ENV ONAP_USERNAME guest
21 ENV ONAP_PASSWORD guest
22
23 ADD ./STAGE $ONAP_CLI_HOME
24 WORKDIR $ONAP_CLI_HOME
25
26 RUN chmod +x ./bin/onap.sh
27 RUN ln ./bin/onap.sh /usr/sbin/onap
28 RUN if [ ! -d ./data ]; then mkdir ./data; fi
29 RUN if [ ! -d ./onap-cli-schema ]; then mkdir ./onap-cli-schema; fi
30
31 COPY ./STAGE/http/lighttpd/lighttpd.conf /etc/lighttpd/lighttpd.conf
32 COPY ./STAGE/http/web /var/www-data/servers/onap-cli/
33 COPY ./STAGE/installer/*.zip /var/www-data/servers/onap-cli/
34 RUN if [ ! -f /var/log/lighttpd/access.log ]; then touch /var/log/lighttpd/access.log; fi
35 COPY ./STAGE/http/lighttpd/10-proxy.conf /etc/lighttpd/conf-enabled/
36 RUN cp /etc/lighttpd/conf-available/10-accesslog.conf /etc/lighttpd/conf-enabled/
37
38 #Lighttpd
39 EXPOSE 80
40
41 #gotty
42 EXPOSE 8080
43
44 ENTRYPOINT if [ "$CLI_MODE" = "daemon" ]; then service lighttpd start; gotty --permit-write --reconnect onap; else onap -v && /bin/bash; fi
45
46 RUN echo ONAP CLI docker successfully created !!