47 lines
1.7 KiB
Docker
47 lines
1.7 KiB
Docker
# Secure temp download stage
|
|
FROM ubuntu:18.04 as intermediate
|
|
ENV DEBIAN_FRONTEND=noninteractive TZ=Europe/Berlin
|
|
|
|
# Setup git
|
|
RUN apt-get update && \
|
|
apt-get -y install git && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
# 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 && \
|
|
git clone git@${PROP_SERVER}:${PROP_DIR_SDR}/ldpc.git move2radio-prop/ldpc && \
|
|
git clone git@${PROP_SERVER}:${PROP_DIR_SDR}/gr-ccsds.git move2radio-prop/gr-ccsds
|
|
|
|
# Build stage
|
|
FROM ubuntu:18.04
|
|
ENV DEBIAN_FRONTEND=noninteractive TZ=Europe/Berlin
|
|
|
|
# Setup build deps
|
|
RUN apt-get update && \
|
|
apt-get -y install build-essential git cmake python2.7 python-pip wget autoconf unzip libtool-bin pkgconf && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
# Copy sources from download stage
|
|
COPY --from=intermediate /app /app
|
|
|
|
# Build sources
|
|
WORKDIR /app/move2radio
|
|
RUN mkdir build && cd build && \
|
|
cmake -DAPPIMAGE=OFF -DLDPC_OFFLINE=ON -DGR_CCSDS_OFFLINE=ON -DOFFLINE_DEPENDENCY_PATH=/app/move2radio-prop .. && \
|
|
make build_gr_ccsds
|
|
|
|
ENTRYPOINT ["/bin/bash"] |