Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
44 lines (38 loc) · 1.49 KB
/
Copy pathDockerfile
File metadata and controls
44 lines (38 loc) · 1.49 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
# syntax=docker/dockerfile:1
# bump: librtmp /LIBRTMP_COMMIT=([[:xdigit:]]+)/ gitrefs:https://git.ffmpeg.org/rtmpdump.git|re:#^refs/heads/master$#|@commit
# bump: librtmp after ./hashupdate Dockerfile LIBRTMP $LATEST
# bump: librtmp link "Commit diff $CURRENT..$LATEST" https://git.ffmpeg.org/gitweb/rtmpdump.git/commitdiff/$LATEST?ds=sidebyside
ARG LIBRTMP_URL="https://git.ffmpeg.org/rtmpdump.git"
ARG LIBRTMP_COMMIT=138fdb258d9fc26f1843fd1b891180416c9dc575
# Must be specified
ARG ALPINE_VERSION
FROM alpine:${ALPINE_VERSION} AS base
FROM base AS download
ARG LIBRTMP_URL
ARG LIBRTMP_COMMIT
WORKDIR /tmp
RUN \
apk add --no-cache --virtual download \
git && \
git clone "$LIBRTMP_URL" rtmpdump && \
cd rtmpdump && git checkout --recurse-submodules $LIBRTMP_COMMIT && \
apk del download
FROM base AS build
COPY --from=download /tmp/rtmpdump/ /tmp/rtmpdump/
WORKDIR /tmp/rtmpdump
RUN \
apk add --no-cache --virtual build \
build-base pkgconf \
openssl-dev openssl-libs-static \
zlib-dev zlib-static \
linux-headers && \
make SYS=posix SHARED=off -j$(nproc) install && \
pkg-config --exists --modversion --path librtmp && \
ar -t /usr/local/lib/librtmp.a && \
readelf -h /usr/local/lib/librtmp.a && \
apk del build
FROM scratch
ARG LIBRTMP_COMMIT
COPY --from=build /usr/local/lib/pkgconfig/librtmp.pc /usr/local/lib/pkgconfig/librtmp.pc
COPY --from=build /usr/local/lib/librtmp.a /usr/local/lib/librtmp.a
COPY --from=build /usr/local/include/librtmp/ /usr/local/include/librtmp/