-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
98 lines (74 loc) · 2.55 KB
/
Copy pathDockerfile
File metadata and controls
98 lines (74 loc) · 2.55 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
98
ARG NDI_SDK_DIR
ARG NDI_SDK_VERSION
ARG NDI_SDK_FLAVOR
ARG GST_RS_VERSION=gstreamer-1.27.2
FROM ubuntu:24.04 AS base
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
supervisor \
avahi-daemon \
avahi-utils \
gstreamer1.0-tools \
gstreamer1.0-plugins-base-apps \
gstreamer1.0-plugins-good \
gstreamer1.0-plugins-bad \
gstreamer1.0-plugins-ugly \
python3-pip \
gir1.2-gstreamer-1.0 \
python3-gi && \
apt-get clean && rm -rf /var/lib/apt/lists/*
# Install NDI libraries from NDI SDK
ARG NDI_SDK_DIR
ARG NDI_SDK_VERSION
COPY ["${NDI_SDK_DIR}/lib/x86_64-linux-gnu/libndi.so.${NDI_SDK_VERSION}", "/usr/lib/"]
RUN ln -s /usr/lib/libndi.so.${NDI_SDK_VERSION} /usr/lib/libndi.so && \
ldconfig
COPY ndi-config.v1.json /root/.ndi/ndi-config.v1.json
FROM base AS build
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
build-essential \
curl \
ca-certificates \
cmake \
git \
pkg-config \
libssl-dev \
libgstreamer1.0-dev \
libgstreamer-plugins-base1.0-dev
# Install NDI libraries from NDI SDK
COPY ["${NDI_SDK_DIR}/include/*.h", "/usr/include/"]
# Install Rust with cargo-c
ENV PATH="/root/.cargo/bin:${PATH}"
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \
cargo install cargo-c
# Build gst-plugins-rs/net/ndi
ARG GST_RS_VERSION
ARG NDI_SDK_FLAVOR
RUN git clone --branch $GST_RS_VERSION --depth 1 \
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git /build/gst-plugins-rs
WORKDIR /build/gst-plugins-rs/net/ndi
RUN FEATURE_FLAG="" && \
if [ "$NDI_SDK_FLAVOR" = "advanced" ]; then \
FEATURE_FLAG="--features advanced-sdk"; \
fi && \
cargo cinstall -p gst-plugin-ndi \
$FEATURE_FLAG \
--prefix=/artifacts/gst-plugins-rs-net-ndi
FROM base AS runtime
COPY --from=build /artifacts/gst-plugins-rs-net-ndi/ /usr/
WORKDIR /app
FROM runtime AS test
RUN pip3 install --break-system-packages pytest==8.4.2
COPY src /app
ENTRYPOINT ["pytest", "--disable-warnings", "--maxfail=3", "."]
FROM runtime AS release
# Configure supervisor
COPY supervisor/supervisord.conf /etc/supervisor/supervisord.conf
COPY supervisor/dbus.conf /etc/supervisor/conf.d/
COPY supervisor/avahi.conf /etc/supervisor/conf.d/
COPY supervisor/ndi-loop-camera.conf /etc/supervisor/conf.d/
RUN mkdir -p /var/run/dbus
RUN pip3 install --break-system-packages ruff mypy
COPY src /app
ENTRYPOINT ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]