forked from igortern/bbf-wt451-polt-sim
-
Notifications
You must be signed in to change notification settings - Fork 2
/
run-no-bins.dockerfile
executable file
·61 lines (47 loc) · 1.65 KB
/
run-no-bins.dockerfile
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# image to build the code
# 20.04
ARG OBBAA_OLT_ADAPTER_VERSION="2.1"
ARG FROM_TAG=20.04
FROM ubuntu:$FROM_TAG
ARG OBBAA_OLT_ADAPTER_VERSION
ARG PASSWD=root
ARG DEBUG=y
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get --yes install \
openssh-client \
openssl \
&& if [ -n "$DEBUG" ] ; \
then DEBIAN_FRONTEND=noninteractive apt-get --yes install \
vim \
gdb \
wget \
net-tools \
iputils-ping \
python3 \
python3-pip \
tshark \
valgrind ; \
else : ; fi \
&& apt-get clean
RUN echo root:$PASSWD | chpasswd
ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/lib"
ENV PYTHONIOENCODING="utf8"
# copy build/fs subdirs to /usr/local
COPY certificates/ certificates/
COPY python_files/ python_files/
RUN mkdir -p opt/obbaa-polt-simulator/build/fs && cp -Rsf /usr/local/* \
/opt/obbaa-polt-simulator/build/fs/ && ldconfig && echo root:$PASSWD | chpasswd
# generate RSA key pair
RUN mkdir -p /root/.ssh
RUN openssl genrsa -out /root/.ssh/polt.pem
RUN openssl req -new -x509 -sha256 -key /root/.ssh/polt.pem -out /root/.ssh/polt.cer -days 3650 -config certificates/request.conf
# Rest Api polt installations
RUN mkdir -p /api/installations
COPY requirements.txt /api/installations/requirements.txt
WORKDIR /api/installations
RUN PYTHONPATH=/api/installations \
&& pip install --upgrade pip \
&& pip3 install -r requirements.txt
COPY . /api/installations
# copy the simulator's certificate and start netopeer2
ENTRYPOINT ["/usr/local/start_netconf_server.sh"]