Skip to content

Commit

Permalink
docker: use OpenCV patch to build fully static GStreamer with plugins…
Browse files Browse the repository at this point in the history
… included

Signed-off-by: deadprogram <[email protected]>
  • Loading branch information
deadprogram committed Oct 21, 2024
1 parent f4870fb commit b65ae60
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions Dockerfile.opencv-static-alpine
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ RUN apk update && apk add --no-cache \
libxml2-dev \
bison \
flex \
glib-dev \
glib-dev glib-static \
gobject-introspection-dev \
libcap-dev \
libcap-utils \
Expand All @@ -54,7 +54,14 @@ RUN apk update && apk add --no-cache \
COPY --from=gstreamer-amd64 /gstbin/lib /usr/local/lib
COPY --from=gstreamer-amd64 /gstbin/include/gstreamer-1.0/gst /usr/local/include/gst

# patch opencv for static gstreamer
COPY ./patches/gstreamer-full.patch /opencv/opencv
RUN cd /opencv/opencv && \
patch -p1 < gstreamer-full.patch

# Build OpenCV
ENV GSTREAMER_STATIC_LIB=/usr/local/lib/gstreamer-1.0

WORKDIR /opencv/opencv/build
RUN cmake -D CMAKE_BUILD_TYPE=Release \
-D CMAKE_INSTALL_PREFIX=/usr/local \
Expand Down Expand Up @@ -134,7 +141,7 @@ RUN apk update && apk add --no-cache \
libxml2-dev \
bison \
flex \
glib-dev \
glib-dev glib-static \
gobject-introspection-dev \
libcap-dev \
libcap-utils \
Expand All @@ -144,7 +151,14 @@ RUN apk update && apk add --no-cache \
COPY --from=gstreamer-arm64 /gstbin/lib /usr/local/lib
COPY --from=gstreamer-arm64 /gstbin/include/gstreamer-1.0/gst /usr/local/include/gst

# patch opencv for static gstreamer
COPY ./patches/gstreamer-full.patch /opencv/opencv
RUN cd /opencv/opencv && \
patch -p1 < gstreamer-full.patch

# Build OpenCV
ENV GSTREAMER_STATIC_LIB=/usr/local/lib/gstreamer-1.0

WORKDIR /opencv/opencv/build
RUN cmake -D CMAKE_BUILD_TYPE=Release \
-D CMAKE_INSTALL_PREFIX=/usr/local \
Expand Down

0 comments on commit b65ae60

Please sign in to comment.