This repository was archived by the owner on Oct 13, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
97 lines (81 loc) · 2.56 KB
/
Copy pathDockerfile
File metadata and controls
97 lines (81 loc) · 2.56 KB
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
FROM debian:bookworm as blah2_env
LABEL maintainer="Jehan <jehan.azad@gmail.com>"
LABEL org.opencontainers.image.source https://github.com/30hours/blah2
WORKDIR /opt/blah2
ADD lib lib
# Install base dependencies
RUN apt-get update && apt-get install -y \
g++ \
make \
cmake \
ninja-build \
git \
curl \
zip \
unzip \
doxygen \
graphviz \
expect \
libfftw3-dev \
pkg-config \
gfortran \
libhackrf-dev \
libusb-dev \
libusb-1.0.0-dev \
libiio-dev \
python3-pip \
python3-mako \
python3-numpy \
libboost-all-dev \
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*
# install dependencies from vcpkg
ENV VCPKG_ROOT=/opt/vcpkg
ENV CC=/usr/bin/gcc
ENV CXX=/usr/bin/g++
RUN export PATH="/opt/vcpkg:${PATH}" \
&& git clone https://github.com/microsoft/vcpkg /opt/vcpkg \
&& if [ "$(uname -m)" = "aarch64" ]; then export VCPKG_FORCE_SYSTEM_BINARIES=1; fi \
&& /opt/vcpkg/bootstrap-vcpkg.sh -disableMetrics \
&& cd /opt/blah2/lib && vcpkg integrate install \
&& vcpkg install --clean-after-build
# install SDRplay API
USER root
RUN export ARCH=$(uname -m) \
&& if [ "$ARCH" = "x86_64" ]; then \
ARCH="amd64"; \
elif [ "$ARCH" = "aarch64" ]; then \
ARCH="arm64"; \
fi \
&& export MAJVER="3.15" \
&& export MINVER="2" \
&& export VER=${MAJVER}.${MINVER} \
&& cd /opt/blah2/lib/sdrplay-${VER} \
&& chmod +x SDRplay_RSP_API-Linux-${VER}.run \
&& ./SDRplay_RSP_API-Linux-${VER}.run --noexec --target /opt/blah2/lib/sdrplay-${VER}/extract \
# Then manually copy the files to the target location
&& cp -r /opt/blah2/lib/sdrplay-${VER}/extract/* /opt/blah2/lib/sdrplay-${VER}/ \
&& cp ${ARCH}/libsdrplay_api.so.${MAJVER} /usr/local/lib/libsdrplay_api.so.${MAJVER} \
&& cp inc/* /usr/local/include \
&& chmod 644 /usr/local/lib/libsdrplay_api.so.${MAJVER}
FROM blah2_env as blah2
LABEL maintainer="Jehan <jehan.azad@gmail.com>"
WORKDIR /opt/blah2
ADD src src
ADD test test
ADD CMakeLists.txt CMakePresets.json Doxyfile ./
# Updated build step to use the correct binary location
RUN set -ex \
&& mkdir -p build \
&& cd build \
&& cmake -S .. --preset prod-release \
-DCMAKE_PREFIX_PATH=$(echo /opt/blah2/lib/vcpkg_installed/*/share) \
&& cd prod-release \
&& make \
&& echo "==== Binary location: ====" \
&& ls -l /opt/blah2/bin/blah2 \
&& mkdir -p /blah2/bin \
&& cp -v /opt/blah2/bin/blah2 /blah2/bin/ \
&& chmod +x /blah2/bin/blah2
WORKDIR /blah2/bin