Unverified Commit 545422c1 authored by Michel Roelofs's avatar Michel Roelofs Committed by Tammo Jan Dijkema
Browse files

Split container building from execution

parent d510d1f0
......@@ -10,30 +10,41 @@
# Start the docker container with
# docker run -it -p 8000:8000 consoledemo
# Then visit the consoledemo from the host machine at http://localhost:8000
FROM debian:buster
FROM debian:buster AS builder
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 apt-get -y install vim autoconf make gcc libtool-bin libglib2.0-dev libbison-dev flex git cmake build-essential libssl-dev libmagic-dev wget libwebsockets-dev
RUN mkdir -p /var/www/console/htdocs/tle && cd /var/www/console/htdocs/tle && wget "http://celestrak.com/NORAD/elements/amateur.txt" -v -O amateur.txt && wget "http://celestrak.com/NORAD/elements/tle-new.txt" -v -O tle-new.txt && wget "http://celestrak.com/NORAD/elements/gps-ops.txt" -v -O gps-ops.txt && cd -
RUN cd /root && git clone git://git.code.sf.net/p/libnova/libnova libnova-libnova
RUN cd /root/libnova-libnova && git checkout 655bcd1 && libtoolize && autoreconf -i && ./configure && make install
RUN cd /root && git clone https://github.com/warmcat/libwebsockets.git
RUN cd /root/libwebsockets && git checkout v2.4.2 && mkdir build && cd build && cmake .. && make && make install
RUN cd /root && git clone https://gitlab.camras.nl/dijkema/dt_ctrl
RUN cd /root/dt_ctrl && autoconf && ./configure --with-libwebsockets=/usr/local && make
RUN cd /root/dt_ctrl && autoconf && ./configure --with-libwebsockets=/usr && make
RUN cd /root/dt_ctrl && make console/console/console_httpd
RUN mkdir -p /var/log/dt/traces
RUN ldconfig
# Create BUILDER container
FROM debian:buster AS runner
#RUN apt -y update && apt -y install screen libwebsockets-dev libmagic-dev wget libglib2.0
#RUN apt -y update && apt -y install screen libwebsockets8 libmagic-dev wget libglib2.0
RUN apt -y update && apt -y install screen
RUN apt -y install libwebsockets8
RUN apt -y install libglib2.0-0
RUN apt -y install libmagic-dev
RUN apt -y install wget
RUN chmod a+rwx /root
RUN mkdir -p /var/www/
RUN mkdir -p /var/www/console/htdocs/tle && cd /var/www/console/htdocs/tle && wget "http://celestrak.com/NORAD/elements/amateur.txt" -v -O amateur.txt && wget "http://celestrak.com/NORAD/elements/tle-new.txt" -v -O tle-new.txt && wget "http://celestrak.com/NORAD/elements/gps-ops.txt" -v -O gps-ops.txt && cd -
RUN mkdir -p /var/www/console
RUN mkdir -p /var/www/console/ && cp -r /root/dt_ctrl/console/htdocs /var/www/console && cp -r /root/dt_ctrl/console/js /var/www/console
#RUN mkdir -p /var/www/console/ && cp -r /root/dt_ctrl/console/htdocs /var/www/console && cp -r /root/dt_ctrl/console/js /var/www/console
RUN mkdir -p /var/www/console/
COPY --from=builder /root/dt_ctrl/console/htdocs /var/www/console/htdocs
COPY --from=builder /root/dt_ctrl/console/js /var/www/console/js
COPY --from=builder /root/dt_ctrl /root/dt_ctrl
COPY --from=builder /var/www/console/htdocs/tle /var/www/console/htdocs
# Configure ports for the console and controller
RUN mkdir /etc/dt && echo '\
......@@ -48,11 +59,9 @@ path=/var/www/console/htdocs\n\
port=8000\n\
' > /etc/dt/dt_host.ini
# Patch the console software to point the websockets port
#RUN sed -i -e 's/window.location.host/window.location.hostname+":8000"/' /var/www/console/htdocs/index.html && \
# sed -i -e 's/window.location.host/window.location.hostname+":8000"/' /var/www/console/htdocs/mech.html
RUN groupadd -g 80000 consoledemo && useradd -g consoledemo -M -u 80000 consoledemo
RUN mkdir -p /var/log/dt/traces && chown consoledemo.consoledemo /var/log/dt/traces
RUN chown consoledemo.consoledemo /var/www/console/htdocs/tle
USER consoledemo:consoledemo
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment