-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile.xrfcrun.ubuntu20
142 lines (127 loc) · 3.97 KB
/
Dockerfile.xrfcrun.ubuntu20
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
#---------------------------------------------------------------------
# BUILDER IMAGE
#---------------------------------------------------------------------
FROM ubuntu:focal as xrfc-builder
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && DEBIAN_FRONTEND=noninteractive apt-get install --yes \
tzdata \
build-essential \
psmisc \
net-tools \
bc \
tshark \
iputils-ping \
iptables \
vim \
iperf3 \
iproute2 \
libconfig++9v5 \
libsctp1 \
pkg-config \
dh-autoreconf \
ncurses-dev \
build-essential \
libssl-dev \
libpcap-dev \
libncurses5-dev \
libsctp-dev \
lksctp-tools \
libprotobuf-dev \
protobuf-compiler \
git \
curl \
libcurl4-openssl-dev \
gpg \
wget \
ninja-build \
libboost-all-dev \
libgtest-dev \
nlohmann-json3-dev \
&& rm -rf /var/lib/apt/lists/*
RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null && \
echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ focal main' | tee /etc/apt/sources.list.d/kitware.list >/dev/null && \
apt-get update && \
rm /usr/share/keyrings/kitware-archive-keyring.gpg && \
apt-get install kitware-archive-keyring && \
echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ focal-rc main' | tee -a /etc/apt/sources.list.d/kitware.list >/dev/null && \
apt-get update && \
apt-get install cmake -y
WORKDIR /root
RUN git clone https://github.com/arun11299/cpp-jwt.git
WORKDIR /root/cpp-jwt
RUN mkdir build
WORKDIR /root/cpp-jwt/build
RUN cmake ../ && make -j8 && make install && ldconfig
WORKDIR /root
RUN git clone https://github.com/gabime/spdlog.git
WORKDIR /root/spdlog
RUN mkdir build
WORKDIR /root/spdlog/build
RUN cmake .. && make -j8 && make install && ldconfig
WORKDIR /root
RUN git clone https://github.com/nanomsg/nng.git
WORKDIR /root/nng
RUN mkdir build
WORKDIR /root/nng/build
RUN cmake -G Ninja .. && ninja && ninja install && ldconfig
WORKDIR /root
RUN git clone https://github.com/pistacheio/pistache.git
WORKDIR /root/pistache
RUN git checkout e18ed9baeb2145af6f9ea41246cf48054ffd9907
WORKDIR /root
WORKDIR /root/pistache
RUN mkdir build
WORKDIR /root/pistache/build
RUN cmake .. && make -j8 && make install && ldconfig
WORKDIR /root
# Add xrfserver build
COPY ./xrfclient /root/xrfclient
WORKDIR /root/xrfclient/src
RUN ./build_script.sh
#---------------------------------------------------------------------
# TARGET IMAGE
#---------------------------------------------------------------------
FROM ubuntu:focal as xrfc
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && DEBIAN_FRONTEND=noninteractive apt-get install --yes \
tzdata \
net-tools \
bc \
tshark \
iputils-ping \
iptables \
vim \
iperf3 \
iproute2 \
libconfig++9v5 \
libssl-dev \
libpcap-dev \
libncurses5-dev \
libcurl4-openssl-dev \
nlohmann-json3-dev \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /xrfclient/bin
COPY --from=xrfc-builder \
/root/xrfclient/src/build/xappclient \
/root/xrfclient/src/prv_xrf \
/root/xrfclient/src/prv_xapp \
/root/xrfclient/src/pub_xrf \
/root/xrfclient/src/pub_xapp \
./
WORKDIR /usr/lib/x86_64-linux-gnu
COPY --from=xrfc-builder \
/usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4 \
/usr/lib/x86_64-linux-gnu/librtmp.so.1 \
/usr/lib/x86_64-linux-gnu/libpsl.so.5 \
/usr/lib/x86_64-linux-gnu/libcurl.so.4 \
/usr/lib/x86_64-linux-gnu/libboost_system.so.1.71.0 \
/usr/lib/x86_64-linux-gnu/libboost_thread.so.1.71.0 \
./
WORKDIR /usr/local/lib
COPY --from=xrfc-builder \
/usr/local/lib/libpistache.so \
./
RUN ldconfig && \
ldd /xrfclient/bin/xappclient
WORKDIR /xrfclient/bin
# expose ports
EXPOSE 9090
CMD ["sleep", "infinity"]