Dockerfile 1.63 KB
Newer Older
Tammo Jan Dijkema's avatar
Tammo Jan Dijkema committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# To use this Dockerfile:
# Create an empty directory and cd inside it.
# Get the source code from dt_ctrl in a subdirectry, e.g. through git:
# ```
# git clone gitlab.camras.nl/dijkema/dt_ctrl
# ```
# Copy the Dockerfile to the empty directory: `cp dt_ctrl/Dockerfile .`
# Tar the source code with `tar czf dt_ctrl.tgz dt_ctrl`
# Create the docker file with `docker build --tag consoledemo .`
FROM ubuntu:16.04

RUN apt-get -y update
RUN apt-get -y install vim autoconf make gcc libtool-bin libglib2.0-dev libbison-dev flex git cmake build-essential libssl-dev screen telnet libmagic-dev wget

RUN cd /root && git clone git://git.code.sf.net/p/libnova/libnova libnova-libnova
RUN cd /root/libnova-libnova && libtoolize && autoreconf -i && ./configure && make install

RUN cd /root && git clone https://github.com/warmcat/libwebsockets.git
RUN cd /root/libwebsockets && mkdir build && cd build && cmake .. && make && make install

ADD dt_ctrl.tgz /root
RUN cd /root tar xf dt_ctrl.tgz

RUN cd /root/dt_ctrl && autoconf && ./configure --with-libwebsockets=/usr/local && make
RUN cd /root/dt_ctrl && make console/console/console_httpd
RUN mkdir -p /var/log/dt/traces

RUN ldconfig

RUN chmod a+rwx /root
RUN mkdir -p /var/www/
RUN cp -r /root/dt_ctrl/console/htdocs /var/www/
RUN cp -r /root/dt_ctrl/console/js /var/www/
RUN mkdir -p /var/www/htdocs/tle && touch /var/www/htdocs/tle/amateur.txt && touch /var/www/htdocs/tle/gps-ops.txt && touch /var/www/htdocs/tle/tle-new.txt

CMD screen -d -m /root/dt_ctrl/controller/dt_ctrl /root/dt_ctrl/controller/dt_ctrl.ctrl && screen -d -m bash -c 'cd /root/dt_ctrl/console/console && ./start_console.sh' && /bin/bash

EXPOSE 80