-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
113 lines (91 loc) · 3.54 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
FROM raspbian/stretch as build
ENV DEBIAN_FRONTEND=noninteractive
ENV TARGET_DIR=/opt/gstreamer
ENV PKG_CONFIG_PATH="$TARGET_DIR/lib/pkgconfig"
ENV PATH=$TARGET_DIR:$TARGET_DIR/bin:$PATH
RUN mkdir -p /src $TARGET_DIR/lib/pkgconfig
ENV SRC_DIR=/src
RUN apt-get update
RUN apt-get install -y \
wget git libtool autoconf \
cmake build-essential pkg-config\
patchelf
WORKDIR $SRC_DIR
RUN apt-get install -y \
libasound2-dev autopoint bison flex python3 libglib2.0-dev gettext
FROM build as dep-gstreamer
RUN git clone --depth 1 --branch 1.14 git://anongit.freedesktop.org/git/gstreamer/gstreamer
WORKDIR /src/gstreamer
RUN ./autogen.sh --noconfigure
RUN ./configure --prefix=$TARGET_DIR --disable-check --disable-tests --disable-examples --disable-benchmarks --disable-debug
RUN make -j4
RUN make install
FROM build as dep-openssl
RUN wget -q https://www.openssl.org/source/openssl-1.1.1a.tar.gz
RUN tar xf openssl-1.1.1a.tar.gz
WORKDIR /src/openssl-1.1.1a
RUN ./config shared --prefix=$TARGET_DIR
RUN make -j4
RUN make install
FROM build as dep-x264
RUN git clone --depth 1 --branch stable https://code.videolan.org/videolan/x264.git
WORKDIR /src/x264
RUN ./configure --prefix=$TARGET_DIR --enable-shared --disable-opencl --enable-pic
RUN make -j4
RUN make install
FROM build as dep-plugins-base
COPY --from=dep-gstreamer $TARGET_DIR $TARGET_DIR
COPY --from=dep-openssl $TARGET_DIR $TARGET_DIR
COPY --from=dep-x264 $TARGET_DIR $TARGET_DIR
RUN git clone --depth 1 --branch 1.14 git://anongit.freedesktop.org/git/gstreamer/gst-plugins-base
WORKDIR /src/gst-plugins-base
RUN ./autogen.sh --noconfigure
RUN ./configure --prefix=$TARGET_DIR --disable-examples --disable-debug
RUN make -j4
RUN make install
WORKDIR /src
FROM dep-plugins-base as dep-plugins-good
RUN git clone --depth 1 --branch 1.14 git://anongit.freedesktop.org/git/gstreamer/gst-plugins-good
WORKDIR /src/gst-plugins-good
RUN ./autogen.sh --noconfigure
RUN ./configure --prefix=$TARGET_DIR --disable-examples --disable-debug
RUN make -j4
RUN make install
FROM dep-plugins-base as dep-plugins-bad
RUN git clone --depth 1 --branch 1.14 git://anongit.freedesktop.org/git/gstreamer/gst-plugins-bad
WORKDIR /src/gst-plugins-bad
RUN ./autogen.sh --noconfigure
RUN ./configure --prefix=$TARGET_DIR --disable-examples --disable-debug
RUN make -j4
RUN make install
FROM dep-plugins-base as dep-plugins-ugly
RUN git clone --depth 1 --branch 1.14 git://anongit.freedesktop.org/git/gstreamer/gst-plugins-ugly
WORKDIR /src/gst-plugins-ugly
RUN ./autogen.sh --noconfigure
RUN ./configure --prefix=$TARGET_DIR --disable-examples --disable-debug
RUN make -j4
RUN make install
FROM dep-plugins-base as dep-gst-rtsp
RUN git clone --depth 1 --branch 1.14 git://anongit.freedesktop.org/git/gstreamer/gst-rtsp-server
WORKDIR /src/gst-rtsp-server
RUN ./autogen.sh --noconfigure
RUN ./configure --prefix=$TARGET_DIR
RUN make -j4
RUN make install
FROM dep-plugins-base as dep-rpicamsrc
# needed to avoid "configure: error: Raspberry Pi files not found in /opt/vc/include"
COPY . /opt/vc
ENV LD_LIBRARY_PATH=/opt/vc/lib
RUN git clone --depth 1 --branch master https://github.com/thaytan/gst-rpicamsrc.git
WORKDIR /src/gst-rpicamsrc
RUN ./autogen.sh --noconfigure
RUN ./configure --prefix=$TARGET_DIR
RUN make -j4
RUN make install
FROM build
COPY --from=dep-gstreamer $TARGET_DIR $TARGET_DIR
COPY --from=dep-plugins-good $TARGET_DIR $TARGET_DIR
COPY --from=dep-plugins-bad $TARGET_DIR $TARGET_DIR
COPY --from=dep-plugins-ugly $TARGET_DIR $TARGET_DIR
COPY --from=dep-gst-rtsp $TARGET_DIR $TARGET_DIR
COPY --from=dep-rpicamsrc $TARGET_DIR $TARGET_DIR