1 FROM openjdk:8-jre-slim
3 #Setup default software
4 RUN apt-get update && apt-get install -y lighttpd git curl pandoc vim
7 RUN cd /tmp && curl -O https://storage.googleapis.com/golang/go1.9.linux-amd64.tar.gz && \
8 tar -xvf go1.9.linux-amd64.tar.gz && 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/
13 ENV OPEN_CLI_HOME /opt/oclip
14 ENV OPEN_CLI_DEBUG false
15 ENV OPEN_CLI_DEBUG_PORT 5005
16 ENV OPEN_CLI_MODE console
17 ENV OPEN_CLI_PRODUCT_IN_USE open-cli
19 ENV GOTTY_TITLE_FORMAT {{ .command }}
22 ADD ./STAGE $OPEN_CLI_HOME
23 WORKDIR $OPEN_CLI_HOME
25 #Setup the run time environment (RTE)
27 RUN chmod +x ./bin/oclip.sh && \
28 ln ./bin/oclip.sh /usr/sbin/oclip && \
29 if [ ! -d ./data ]; then mkdir ./data; fi && \
30 if [ ! -d ./open-cli-schema ]; then mkdir ./open-cli-schema; fi
32 #Create the readable README
33 RUN pandoc -t plain $OPEN_CLI_HOME/docs/README.md > $OPEN_CLI_HOME/docs/oclip-readme.txt
36 COPY ./STAGE/http/lighttpd/lighttpd.conf /etc/lighttpd/lighttpd.conf
37 COPY ./STAGE/http/web /var/www-data/servers/open-cli/
38 COPY ./STAGE/http/lighttpd/10-proxy.conf /etc/lighttpd/conf-enabled/
39 COPY ./STAGE/installer/cli-*.zip /var/www-data/servers/open-cli/oclip.zip
41 RUN if [ ! -f /var/log/lighttpd/access.log ]; then touch /var/log/lighttpd/access.log; fi
42 RUN cp /etc/lighttpd/conf-available/10-accesslog.conf /etc/lighttpd/conf-enabled/
50 ENTRYPOINT if [ "$OPEN_CLI_MODE" = "daemon" ]; then service lighttpd start; gotty --permit-write --reconnect oclip; else oclip -v && /bin/bash; fi
53 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/*
55 RUN echo Open CLI docker successfully created !!