-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
193 lines (174 loc) · 4.86 KB
/
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
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
ARG BASE_IMAGE=alpine:3.12
FROM ${BASE_IMAGE}
# Install deps.
RUN set -xe; \
apk add --update --no-cache --virtual .runtime-deps \
ca-certificates \
tzdata;
# Create our group & user.
RUN set -xe; \
addgroup -g 1000 -S hertz; \
adduser -u 1000 -S -h /hertz -s /bin/sh -G hertz hertz;
# Set our working directory.
WORKDIR /hertz/src
RUN set -xe; \
apk add --upate --no-cache \
cmake \
alpine-sdk \
python3-dev \
py3-pip \
py3-mako \
py3-pybind11-dev \
git;
# Build Volk
ARG VOLK_VERSION=v2.3.0
RUN set -xe; \
git clone https://github.com/gnuradio/volk.git; \
cd volk; \
git checkout "${VOLK_VERSION}"; \
mkdir build; \
cd build; \
cmake -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=/usr/bin/python3 ../; \
make -j$(nproc); \
ctest -j$(nproc) || echo "qa_volk_16i_32fc_dot_prod_32fc fails"; \
make install
# Add additional build deps
RUN set -xe; \
echo "@testing http://nl.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories; \
apk add --upate --no-cache \
cppzmq@testing \
log4cpp-dev@testing \
log4cpp@testing \
thrift-dev@testing \
thrift@testing; \
apk add --update --no-cache \
alsa-lib \
alsa-lib-dev \
autoconf \
automake \
bash \
boost-dev \
doxygen \
fftw \
fftw-dev \
gmp \
gmp-dev \
gsl \
gsl-dev \
gsm \
gsm-dev \
jack \
jack-dev \
libtool \
man-pages \
mandoc \
mandoc-dev \
mpd \
oxygen \
portaudio \
portaudio-dev \
py3-click \
py3-click-plugins \
py3-numpy \
py3-numpy-dev \
py3-qt5 \
py3-qtwebengine \
py3-scipy \
py3-sphinx \
qt5-qtbase \
qt5-qtbase-dev \
qt5-qtsvg \
qt5-qtsvg-dev \
qt5-qttools \
qt5-qttools-dev \
qt5-qtwebglplugin \
qt5-qtwebglplugin-dev \
qt5-qtwebkit \
qt5-qtwebkit-dev \
sdl \
sdl-dev \
subversion \
swig \
texinfo \
vim \
yasm \
yasm-dev \
zeromq \
zeromq-dev;
# Build MPIR
ARG MPIR_VERSION=mpir-3.0.0
RUN set -xe ; \
git clone --depth 1 https://github.com/wbhart/mpir.git --branch ${MPIR_VERSION}; \
cd mpir; \
autoreconf -i; \
./configure; \
make -j $(getconf _NPROCESSORS_ONLN); \
make install;
# Build codec2
ARG CODEC2_VERSION=v0.9.2
RUN set -xe; \
git clone --depth 1 https://github.com/drowe67/codec2.git --branch ${CODEC2_VERSION}; \
cd codec2; \
mkdir -p build; \
cd build; \
cmake ..; \
make -j $(getconf _NPROCESSORS_ONLN); \
make install;
# Build UHD
ARG UHD_VERSION=v4.0.0.0
RUN set -xe; \
git clone --depth 1 https://github.com/EttusResearch/uhd.git --branch ${UHD_VERSION}; \
mkdir -p uhd/host/build; \
cd uhd/host/build; \
cmake ..; \
make -j $(getconf _NPROCESSORS_ONLN); \
make install;
# Build QWT
ARG QWT_VERSION=qwt-6.1
RUN set -xe; \
svn export svn://svn.code.sf.net/p/qwt/code/branches/qwt-6.1; \
cd qwt-6.1; \
sed -r -i 's|^(\s+)QWT_INSTALL_PREFIX(\s+)=(\s+)\/usr\/local.*$|\1QWT_INSTALL_PREFIX\2=\3/usr|g' qwtconfig.pri; \
qmake-qt5 qwt.pro; \
make -j $(getconf _NPROCESSORS_ONLN); \
make install;
# Build GNU Radio
ARG GNU_RADIO_VERSION=v3.8.2.0
RUN set -xe; \
git clone https://github.com/gnuradio/gnuradio.git; \
cd gnuradio; \
git checkout "${GNU_RADIO_VERSION}"; \
mkdir -p build; \
cd build; \
cmake -Wno-dev -DCMAKE_BUILD_TYPE=Release -DZEROMQ_INCLUDE_DIRS=/usr/include -DMPIRXX_LIBRARY=/usr/local/lib -DMPIR_INCLUDE_DIR=/usr/local/include -DENABLE_INTERNAL_VOLK=OFF -DPYTHON_EXECUTABLE=/usr/bin/python3 ../; \
make -j $(getconf _NPROCESSORS_ONLN); \
make install;
# Ensure hertz ownership
RUN set -xe; \
chown -R hertz:hertz /hertz
# Copy our entrypoint into the container.
COPY ./runtime-assets /
# Build arguments.
ARG VCS_REF
ARG BUILD_DATE
ARG VERSION
# Labels / Metadata.
LABEL \
org.opencontainers.image.authors="James Brink <[email protected]>" \
org.opencontainers.image.created="${BUILD_DATE}" \
org.opencontainers.image.description="Hertz Lattice (GNU Radio)" \
org.opencontainers.image.revision="${VCS_REF}" \
org.opencontainers.image.source="https://github.com/utensils/hertz-lattice" \
org.opencontainers.image.title="Hertz Lattice" \
org.opencontainers.image.vendor="Utensils Union" \
org.opencontainers.image.version="${VERSION}"
# Drop down to our unprivileged user.
USER hertz
# Setup our environment variables.
ENV \
PATH="/usr/local/bin:$PATH" \
VERSION="${VERSION}"
# Set the entrypoint.
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
# Set the default command
CMD ["/bin/sh"]