First version, accesses secure server

This commit is contained in:
Christoph Honal 2020-02-11 23:55:22 +01:00
parent 5739279920
commit f1972406d2
8 changed files with 75 additions and 0 deletions

2
.dockerignore Normal file
View File

@ -0,0 +1,2 @@
scripts/
config/

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.env

47
Dockerfile Normal file
View File

@ -0,0 +1,47 @@
# 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"]

2
config/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
config.sh
id_rsa

1
config/README.md Normal file
View File

@ -0,0 +1 @@
Configure the proprietary code server using the file `config.sh` (see or copy `config.sh.example`), and place or link your private key for the server access here (`ìd_rsa`). Note that this key should not be protected with a password.

4
config/config.sh.example Normal file
View File

@ -0,0 +1,4 @@
export PROP_SERVER=gitlab.lrz.de
export PROP_SERVER_USER=ga123xyz
export PROP_DIR_SDR=sdr
export PROP_DIR_DECODER=mondbaron

12
docker-compose.yml Normal file
View File

@ -0,0 +1,12 @@
version: '3'
services:
move2:
build:
context: .
args:
- PROP_SERVER
- PROP_SERVER_USER
- PROP_SERVER_KEY
- PROP_DIR_SDR
- PROP_DIR_DECODER

6
scripts/build.sh Normal file
View File

@ -0,0 +1,6 @@
#!/bin/bash
cd "${0%/*}/.."
source ./config/config.sh
export PROP_SERVER_KEY=$(cat ./config/id_rsa)
docker-compose build