2020-02-25 23:36:21 +00:00
|
|
|
# Base stage with deps
|
|
|
|
FROM ubuntu:18.04 AS base
|
2020-02-11 22:55:22 +00:00
|
|
|
ENV DEBIAN_FRONTEND=noninteractive TZ=Europe/Berlin
|
|
|
|
|
2020-02-25 23:36:21 +00:00
|
|
|
# Setup build deps
|
2020-02-11 22:55:22 +00:00
|
|
|
RUN apt-get update && \
|
2020-02-25 23:36:21 +00:00
|
|
|
apt-get -y install --no-install-recommends build-essential git cmake autoconf automake unzip libtool-bin pkgconf libssl-dev \
|
|
|
|
python2.7 python-pip python3 python3-pip python-cheetah libcppunit-dev swig uuid-dev libusb-1.0-0-dev \
|
|
|
|
python-mako libzmq3-dev libcomedi-dev python-sip-dev python-six socat \
|
|
|
|
python-numpy python-wxgtk3.0 libzmq3-dev \
|
|
|
|
libqt4-opengl-dev python-qt4 libqwt-dev python-gtk2 python-lxml \
|
|
|
|
git openssh-client ca-certificates && \
|
2020-02-11 22:55:22 +00:00
|
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
|
2020-02-25 23:36:21 +00:00
|
|
|
# Donwnload stage
|
|
|
|
FROM base AS build
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive TZ=Europe/Berlin
|
|
|
|
|
2020-02-11 22:55:22 +00:00
|
|
|
# Setup key and server for proprietary code
|
|
|
|
ARG PROP_SERVER
|
|
|
|
ARG PROP_SERVER_USER
|
|
|
|
ARG PROP_SERVER_KEY
|
|
|
|
RUN mkdir /root/.ssh/ && chmod 700 /root/.ssh && \
|
|
|
|
echo "${PROP_SERVER_KEY}" > /root/.ssh/id_rsa && chmod 600 /root/.ssh/id_rsa && \
|
|
|
|
echo "Host ${PROP_SERVER}" > /root/.ssh/config && echo " User ${PROP_SERVER_USER}" >> /root/.ssh/config && \
|
|
|
|
echo " IdentityFile ~/.ssh/id_rsa" >> /root/.ssh/config && chmod 644 /root/.ssh/config && \
|
|
|
|
touch /root/.ssh/known_hosts && chmod 644 /root/.ssh/known_hosts && \
|
|
|
|
ssh-keyscan -H ${PROP_SERVER} >> /root/.ssh/known_hosts
|
|
|
|
|
|
|
|
# Clone sources
|
|
|
|
ARG PROP_DIR_SDR
|
|
|
|
ARG PROP_DIR_DECODER
|
|
|
|
WORKDIR /app
|
|
|
|
RUN git clone https://github.com/MOVE-II/move2radio.git && \
|
2020-02-12 05:02:06 +00:00
|
|
|
cd move2radio && git checkout 6fcbae73359b0618312d222148aba07799a43a47 && git reset --hard && cd .. && \
|
2020-02-11 22:55:22 +00:00
|
|
|
git clone git@${PROP_SERVER}:${PROP_DIR_SDR}/ldpc.git move2radio-prop/ldpc && \
|
2020-02-12 05:02:06 +00:00
|
|
|
git clone git@${PROP_SERVER}:${PROP_DIR_SDR}/gr-ccsds.git move2radio-prop/gr-ccsds && \
|
2020-02-25 23:36:21 +00:00
|
|
|
git clone git@${PROP_SERVER}:${PROP_DIR_SDR}/libfec.git move2radio-prop/fec
|
2020-02-11 22:55:22 +00:00
|
|
|
|
|
|
|
# Build sources
|
2020-02-26 00:20:28 +00:00
|
|
|
RUN mkdir -p /app/move2radio-prop/fec/build && cd /app/move2radio-prop/fec/build && \
|
|
|
|
cmake -DCMAKE_INSTALL_PREFIX=/app/move2radio/build/prefix/usr .. && make && make install && \
|
|
|
|
mkdir -p /app/move2radio-prop/ldpc/build && cd /app/move2radio-prop/ldpc/build && \
|
|
|
|
cmake -DCMAKE_INSTALL_PREFIX=/app/move2radio/build/prefix/usr .. && make && make install
|
2020-02-14 00:55:31 +00:00
|
|
|
COPY build/CMakeLists.txt /app/move2radio/CMakeLists.txt
|
2020-02-25 13:34:49 +00:00
|
|
|
WORKDIR /app/move2radio/build
|
2020-02-26 20:01:07 +00:00
|
|
|
RUN cmake -DAPPIMAGE=OFF -DCONDA_ENV=OFF -DLDPC_OFFLINE=ON -DGR_CCSDS_OFFLINE=ON -DFEC_OFFLINE=ON -DOFFLINE_DEPENDENCY_PATH=/app/move2radio-prop ..
|
|
|
|
RUN make build_boost build_curlpp
|
|
|
|
RUN make build_gr_osmosdr
|
|
|
|
# RUN make move2radio
|
2020-02-12 14:56:29 +00:00
|
|
|
|
2020-02-26 20:01:46 +00:00
|
|
|
# Run stage
|
|
|
|
FROM base AS run
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive TZ=Europe/Berlin
|
|
|
|
ENV PATH="/app/move2radio/build/prefix/usr/bin:${PATH}" \
|
|
|
|
PYTHONPATH="/app/move2radio/build/prefix/usr/lib/python2.7/dist-packages:${PYTHONPATH}" \
|
|
|
|
LD_LIBRARY_PATH="/app/move2radio/build/prefix/usr/lib:${LD_LIBRARY_PATH}"
|
2020-02-12 14:56:29 +00:00
|
|
|
|
2020-02-26 20:01:46 +00:00
|
|
|
# Copy sources from build stage
|
|
|
|
COPY --from=build /app/move2radio/build/prefix/usr /app/move2radio/build/prefix/usr
|
|
|
|
COPY --from=build /app/move2radio/AppDir/move-ii-gr/AR4JA_r12_k1024n.a /app/gnuradio/
|
|
|
|
COPY build/gnuradio/* /app/gnuradio/
|
2020-02-12 14:56:29 +00:00
|
|
|
|
2020-02-26 20:01:46 +00:00
|
|
|
# Install binaries
|
|
|
|
COPY build/fakeserver/* /app/fakeserver/
|
|
|
|
COPY build/run*.sh /app/
|
|
|
|
RUN chmod +x /app/run*.sh && ldconfig
|
2020-02-12 14:56:29 +00:00
|
|
|
|
2020-02-26 20:01:46 +00:00
|
|
|
ENTRYPOINT ["/app/run-cli.sh"]
|