forked from BELABOX/gstlibuvch264src
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
53 lines (44 loc) · 1.49 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
# Use a ARM64 base image
FROM --platform=linux/arm64 ubuntu:latest AS build
# Set the working directory inside the container
WORKDIR /app
# Install essential build tools, GStreamer dependencies, and libusb
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y \
build-essential \
cmake \
git \
meson \
pkg-config \
libgstreamer1.0-dev \
libgstreamer-plugins-base1.0-dev \
libusb-1.0-0 \
libusb-1.0-0-dev
# Clone the necessary repositories
RUN git clone https://github.com/irlserver/gstlibuvch264src.git .
# Build and install libuvc
WORKDIR /app/libuvc
RUN cmake .
RUN make -j$(nproc)
RUN make install
# Build and install libuvch264src
WORKDIR /app
RUN mkdir build
RUN meson setup build ./libuvch264src/
WORKDIR /app/build
RUN meson compile
RUN meson install --no-rebuild
# --- Second Stage: Create a smaller image for just the plugin ---
FROM --platform=linux/arm64 ubuntu:latest AS runtime
# Install runtime dependencies (GStreamer)
RUN apt-get update && apt-get install -y \
libgstreamer1.0-0 \
libgstreamer-plugins-base1.0-0 \
libusb-1.0-0 \
&& rm -rf /var/lib/apt/lists/*
# Create necessary directories
RUN mkdir -p /usr/local/lib/aarch64-linux-gnu/gstreamer-1.0
RUN mkdir -p /usr/lib/aarch64-linux-gnu
# Copy the built GStreamer plugin and libuvc from the build stage
COPY --from=build /usr/local/lib/aarch64-linux-gnu/gstreamer-1.0/libgstlibuvch264src.so /usr/local/lib/aarch64-linux-gnu/gstreamer-1.0/
COPY --from=build /usr/local/lib/libuvc.* /usr/lib/aarch64-linux-gnu/