-
Notifications
You must be signed in to change notification settings - Fork 10
/
Dockerfile
96 lines (80 loc) · 2.25 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
# -------------------
# The build container
# -------------------
FROM debian:buster-slim AS build
# Install build dependencies.
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
cmake \
git \
libusb-1.0-0-dev \
pkg-config \
libatlas-base-dev \
python3 \
python3-dev \
python3-pip \
python3-setuptools \
python3-numpy \
python3-wheel && \
rm -rf /var/lib/apt/lists/*
# Compile and install rtl-sdr.
RUN git clone https://github.com/steve-m/librtlsdr.git /root/librtlsdr && \
mkdir -p /root/librtlsdr/build && \
cd /root/librtlsdr/build && \
cmake -DCMAKE_INSTALL_PREFIX=/root/target/usr/local -Wno-dev ../ && \
make && \
make install && \
rm -rf /root/librtlsdr
# Compile and install ssdv.
RUN git clone https://github.com/fsphil/ssdv.git /root/ssdv && \
cd /root/ssdv && \
make && \
DESTDIR=/root/target make install && \
rm -rf /root/ssdv
# Install Python packages.
# Removed numpy from this list, using system packages.
# --no-binary numpy
RUN --mount=type=cache,target=/root/.cache/pip pip3 install \
--user --no-warn-script-location --ignore-installed \
crcmod \
flask \
flask-socketio \
simple-websocket \
requests \
sondehub
# Copy in wenet.
COPY . /root/wenet
# Build the binaries.
WORKDIR /root/wenet/src
RUN make
# -------------------------
# The application container
# -------------------------
FROM debian:buster-slim
EXPOSE 5003/tcp
# Install application dependencies.
RUN apt-get update && \
apt-get install -y --no-install-recommends \
bc \
libusb-1.0-0 \
python3 \
python3-numpy \
tini && \
rm -rf /var/lib/apt/lists/*
# Copy compiled dependencies from the build container.
COPY --from=build /root/target /
RUN ldconfig
# Copy any additional Python packages from the build container.
COPY --from=build /root/.local /root/.local
# Copy wenet from the build container to /opt.
COPY --from=build /root/wenet/rx/ /opt/wenet/
COPY --from=build /root/wenet/LICENSE.txt /opt/wenet/
# Set the working directory.
WORKDIR /opt/wenet
# Ensure scripts from Python packages are in PATH.
ENV PATH=/root/.local/bin:$PATH
# Use tini as init.
ENTRYPOINT ["/usr/bin/tini", "--"]
# Run start_rx_docker.sh.
CMD ["/opt/wenet/start_rx_docker.sh"]